GreptimeTeam / dashboard

The dashboard UI for GreptimeDB
Apache License 2.0
78 stars 20 forks source link

Display timestamp as human-readable string #409

Closed tisonkun closed 7 months ago

tisonkun commented 7 months ago

Currently, timestamps are displayed as numbers, like UNIX epoch:

image

CREATE TABLE statement:

            CREATE TABLE IF NOT EXISTS keyboard_monitor (
                hits STRING NULL,
                ts TIMESTAMP(3) NOT NULL,
                TIME INDEX ("ts")
            ) ENGINE=mito WITH( regions = 1, ttl = '3months')

Is it possible to let the dashboard display human-readable string, like

mysql> SELECT DISTINCT(ts) FROM keyboard_monitor LIMIT 10;
+----------------------------+
| ts                         |
+----------------------------+
| 2024-03-05 01:27:14.299000 |
| 2024-03-05 01:27:15.450000 |
| 2024-03-05 01:27:15.988000 |
| 2024-03-05 01:27:17.103000 |
| 2024-03-05 01:27:19.048000 |
| 2024-03-05 01:27:21.403000 |
| 2024-03-05 01:27:22.427000 |
| 2024-03-05 01:27:23.158000 |
| 2024-03-05 01:27:24.098000 |
| 2024-03-05 01:27:24.535000 |
+----------------------------+
10 rows in set (0.21 sec)

Or is there a SQL function I can do so?

tisonkun commented 7 months ago

Click this widget and it'll toggle.

image

image