Skip to content

Conversation

@dechdev
Copy link
Contributor

@dechdev dechdev commented Feb 23, 2022

#546

Support for histogram buckets that are grouped by type

Example Response:

[
  {
    "buckets": [
      { "timestamp": "2022-02-23T22:40:33Z", "count": "23" },
      { "timestamp": "2022-02-23T22:45:33Z", "count": "0" },
      { "timestamp": "2022-02-23T22:50:33Z", "count": "14" }
    ],
    "type": "transaction_submitted"
  },
  {
    "buckets": [
      { "timestamp": "2022-02-23T22:40:33Z", "count": "16" },
      { "timestamp": "2022-02-23T22:45:33Z", "count": "0" },
      { "timestamp": "2022-02-23T22:50:33Z", "count": "14" }
    ],
    "type": "blockchain_event"
  },
  {
    "buckets": [
      { "timestamp": "2022-02-23T22:40:33Z", "count": "22" },
      { "timestamp": "2022-02-23T22:45:33Z", "count": "0" },
      { "timestamp": "2022-02-23T22:50:33Z", "count": "11" }
    ],
    "type": "message_confirmed"
  },
  {
    "buckets": [
      { "timestamp": "2022-02-23T22:40:33Z", "count": "1" },
      { "timestamp": "2022-02-23T22:45:33Z", "count": "0" },
      { "timestamp": "2022-02-23T22:50:33Z", "count": "1" }
    ],
    "type": "token_pool_confirmed"
  },
  {
    "buckets": [
      { "timestamp": "2022-02-23T22:40:33Z", "count": "6" },
      { "timestamp": "2022-02-23T22:45:33Z", "count": "0" },
      { "timestamp": "2022-02-23T22:50:33Z", "count": "4" }
    ],
    "type": "token_transfer_confirmed"
  }
]

Signed-off-by: David Echelberger <eberger727@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2022

Codecov Report

Merging #547 (276eb29) into main (9f92329) will decrease coverage by 0.01%.
The diff coverage is 96.61%.

❗ Current head 276eb29 differs from pull request most recent head 9cffb80. Consider uploading reports for the commit 9cffb80 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##              main     #547      +/-   ##
===========================================
- Coverage   100.00%   99.98%   -0.02%     
===========================================
  Files          303      303              
  Lines        17389    17424      +35     
===========================================
+ Hits         17389    17422      +33     
- Misses           0        2       +2     
Impacted Files Coverage Δ
internal/database/sqlcommon/tokentransfer_sql.go 100.00% <ø> (ø)
internal/database/sqlcommon/chart_sql.go 97.70% <96.61%> (-2.30%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f92329...9cffb80. Read the comment docs.

Copy link
Contributor

@awrichar awrichar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be sure I understand - now all histogram queries will now be broken down by type (to readily support a "stacked bar" type of chart) and there is no way to perform the previous simpler query that just gave totals for each time slice - right?

I think this is fine as long as it supports everything we currently want to do on the firefly-ui.

@dechdev
Copy link
Contributor Author

dechdev commented Mar 4, 2022

New Payload format to be compatible with current ui

[
  {
    "count": "38",
    "timestamp": "2022-03-04T21:42:39Z",
    "types": [
      { "count": "13", "type": "transaction_submitted" },
      { "count": "8", "type": "blockchain_event_received" },
      { "count": "0", "type": "identity_confirmed" },
      { "count": "14", "type": "message_confirmed" },
      { "count": "1", "type": "token_pool_confirmed" },
      { "count": "2", "type": "token_transfer_op_failed" }
    ]
  },
  {
    "count": "0",
    "timestamp": "2022-03-04T21:43:19Z",
    "types": [
      { "count": "0", "type": "transaction_submitted" },
      { "count": "0", "type": "blockchain_event_received" },
      { "count": "0", "type": "identity_confirmed" },
      { "count": "0", "type": "message_confirmed" },
      { "count": "0", "type": "token_pool_confirmed" },
      { "count": "0", "type": "token_transfer_op_failed" }
    ]
  },
  {
    "count": "29",
    "timestamp": "2022-03-04T21:43:59Z",
    "types": [
      { "count": "11", "type": "transaction_submitted" },
      { "count": "6", "type": "blockchain_event_received" },
      { "count": "0", "type": "identity_confirmed" },
      { "count": "9", "type": "message_confirmed" },
      { "count": "1", "type": "token_pool_confirmed" },
      { "count": "2", "type": "token_transfer_op_failed" }
    ]
  }
]

@dechdev dechdev merged commit 00fda51 into hyperledger:main Mar 4, 2022
@dechdev dechdev deleted the charts-by-type branch March 4, 2022 22:00
@dechdev dechdev mentioned this pull request Apr 3, 2022
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

Successfully merging this pull request may close these issues.

3 participants