Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve printing format #92

Open
shravandoda opened this issue Mar 6, 2019 · 4 comments
Open

Improve printing format #92

shravandoda opened this issue Mar 6, 2019 · 4 comments

Comments

@shravandoda
Copy link
Contributor

The current printing format in client uses show_data method in querying_mechanism module. It prints the data fetched from redis in an inline manner. Instead of the current printing format we can use the inbuilt printing method in the redis-py module which prints the data in a tabular form.

+-------------+----------+--------------+-----------+
|  b'p.name'  | b'p.age' | b'v.purpose' | b'c.name' |
+-------------+----------+--------------+-----------+`
| b'John Doe' |    33    | b'pleasure'  |  b'Japan' |
+-------------+----------+--------------+-----------+
@Mec-iS Mec-iS changed the title Improve printing format for python-hydra-agent Improve printing format Mar 21, 2019
@shravandoda
Copy link
Contributor Author

shravandoda commented Mar 22, 2019

>>>show endpoints
classEndpoints + CollectionEndpoints
Class Endpoints
+-----------------+-------------+------------------------------+---------------------------+
| b'p.properties' |  b'p.type'  |           b'p.id'            |      b'p.operations'      |
+-----------------+-------------+------------------------------+---------------------------+
| b"['Location']" | b'Location' | b'vocab:EntryPoint/Location' | b"['POST', 'PUT', 'GET']" |
+-----------------+-------------+------------------------------+---------------------------+

b'Query internal execution time: 0.231691 milliseconds'
Collection Endpoints
+----------------------------+---------------------------------------------+-------------------+
|         b'p.type'          |                   b'p.id'                   |  b'p.operations'  |
+----------------------------+---------------------------------------------+-------------------+
|     b'DroneCollection'     |     b'vocab:EntryPoint/DroneCollection'     | b"['GET', 'PUT']" |
|  b'DatastreamCollection'   |   b'vocab:EntryPoint/DatastreamCollection'  | b"['GET', 'PUT']" |
|    b'CommandCollection'    |    b'vocab:EntryPoint/CommandCollection'    | b"['GET', 'PUT']" |
|    b'AnomalyCollection'    |    b'vocab:EntryPoint/AnomalyCollection'    | b"['GET', 'PUT']" |
|  b'HttpApiLogCollection'   |   b'vocab:EntryPoint/HttpApiLogCollection'  | b"['GET', 'PUT']" |
|    b'MessageCollection'    |    b'vocab:EntryPoint/MessageCollection'    | b"['GET', 'PUT']" |
|   b'DroneLogCollection'    |    b'vocab:EntryPoint/DroneLogCollection'   | b"['GET', 'PUT']" |
| b'ControllerLogCollection' | b'vocab:EntryPoint/ControllerLogCollection' | b"['GET', 'PUT']" |
+----------------------------+---------------------------------------------+-------------------+

b'Query internal execution time: 0.221227 milliseconds'

Sample ^
The above data has been generated with the help of redisgraph only. We won't need show_data method for it.
I guess this issue could be taken under coupling hydra-python-agent to redis

@Mec-iS
Copy link
Contributor

Mec-iS commented Mar 22, 2019

looks fine.

I will open a issue about making the agent leveraging Redis all-over the codebase.

@Mec-iS
Copy link
Contributor

Mec-iS commented Mar 22, 2019

See references to older issues in #99
As specified in those issues, the only data represented in memory in the structure of the API taken from the ApiDoc, the rest is all in the datastore.

@sandeepsajan0
Copy link
Contributor

sandeepsajan0 commented Mar 6, 2020

show endpoints
classEndpoints + CollectionEndpoints
Class Endpoints
+-----------------+-------------+------------------------------+---------------------------+
| b'p.properties' | b'p.type' | b'p.id' | b'p.operations' |
+-----------------+-------------+------------------------------+---------------------------+
| b"['Location']" | b'Location' | b'vocab:EntryPoint/Location' | b"['POST', 'PUT', 'GET']" |
+-----------------+-------------+------------------------------+---------------------------+

b'Query internal execution time: 0.231691 milliseconds'
Collection Endpoints
+----------------------------+---------------------------------------------+-------------------+
| b'p.type' | b'p.id' | b'p.operations' |
+----------------------------+---------------------------------------------+-------------------+
| b'DroneCollection' | b'vocab:EntryPoint/DroneCollection' | b"['GET', 'PUT']" |
| b'DatastreamCollection' | b'vocab:EntryPoint/DatastreamCollection' | b"['GET', 'PUT']" |
| b'CommandCollection' | b'vocab:EntryPoint/CommandCollection' | b"['GET', 'PUT']" |
| b'AnomalyCollection' | b'vocab:EntryPoint/AnomalyCollection' | b"['GET', 'PUT']" |
| b'HttpApiLogCollection' | b'vocab:EntryPoint/HttpApiLogCollection' | b"['GET', 'PUT']" |
| b'MessageCollection' | b'vocab:EntryPoint/MessageCollection' | b"['GET', 'PUT']" |
| b'DroneLogCollection' | b'vocab:EntryPoint/DroneLogCollection' | b"['GET', 'PUT']" |
| b'ControllerLogCollection' | b'vocab:EntryPoint/ControllerLogCollection' | b"['GET', 'PUT']" |
+----------------------------+---------------------------------------------+-------------------+

b'Query internal execution time: 0.221227 milliseconds'
Sample ^
The above data has been generated with the help of redisgraph only. We won't need show_data method for it.
I guess this issue could be taken under coupling hydra-python-agent to redis

We have to use this data in demo/UI. This format may be difficult to handle it there otherwise it look fine. But I think redisgraph has updated the query output, so we also need to update or improve the printing method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants