Skip to content

Render a graph with historical metrics value #50

@macbre

Description

@macbre

Library

http://dygraphs.com/

Example: https://my-netdata.io/ (scroll down)

Database query

mysql@geo-db-dev-db-slave.query.consul[mike_holmes]>select timestamp, metric, value from features_metrics where feature = 'ckeditor' order by timestamp DESC limit 20;
+---------------------+--------------------+-------+
| timestamp           | metric             | value |
+---------------------+--------------------+-------+
| 2019-03-01 10:06:13 | editor/publishes   | 16777 |
| 2019-03-01 10:06:13 | editor/impressions | 31226 |
| 2019-03-01 10:06:12 | jira/p3-tickets    |     3 |
| 2019-03-01 10:06:12 | jira/p2-tickets    |     0 |
| 2019-03-01 10:06:12 | score              | 48006 |
| 2019-02-28 22:05:03 | editor/impressions |  5182 |
| 2019-02-28 22:05:03 | jira/p2-tickets    |     0 |
| 2019-02-28 22:05:03 | score              |  8167 |
| 2019-02-28 22:05:03 | editor/publishes   |  2982 |
| 2019-02-28 22:05:03 | jira/p3-tickets    |     3 |
| 2019-02-28 10:05:57 | editor/impressions | 32230 |
| 2019-02-28 10:05:57 | editor/publishes   | 17540 |
| 2019-02-28 10:05:57 | jira/p2-tickets    |     0 |
| 2019-02-28 10:05:57 | jira/p3-tickets    |     3 |
| 2019-02-28 10:05:57 | score              | 49773 |
| 2019-02-27 22:05:53 | score              |  7638 |
| 2019-02-27 22:05:53 | editor/impressions |  4842 |
| 2019-02-27 22:05:53 | editor/publishes   |  2793 |
| 2019-02-27 22:05:53 | jira/p2-tickets    |     0 |
| 2019-02-27 22:05:53 | jira/p3-tickets    |     3 |
+---------------------+--------------------+-------+
20 rows in set (0.00 sec)

Grouped by day

mysql@geo-db-dev-db-slave.query.consul[mike_holmes]>select date(timestamp) as date, metric, value from features_metrics where feature = 'ckeditor' group by date, metric limit 12;
+------------+------------------+-------+
| date       | metric           | value |
+------------+------------------+-------+
| 2019-01-11 | analytics/events | 22198 |
| 2019-01-11 | jira/p2-tickets  |     0 |
| 2019-01-11 | jira/p3-tickets  |     3 |
| 2019-01-11 | score            | 22201 |
| 2019-01-12 | analytics/events | 22198 |
| 2019-01-12 | jira/p2-tickets  |     0 |
| 2019-01-12 | jira/p3-tickets  |     3 |
| 2019-01-12 | score            | 22201 |
| 2019-01-13 | analytics/events | 22655 |
| 2019-01-13 | jira/p2-tickets  |     0 |
| 2019-01-13 | jira/p3-tickets  |     3 |
| 2019-01-13 | score            | 22658 |
+------------+------------------+-------+
12 rows in set (0.00 sec)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions