Skip to content

Commit

Permalink
[Analytics] added browser info (#5893)
Browse files Browse the repository at this point in the history
  • Loading branch information
azhavoro committed Mar 21, 2023
1 parent 4ae8bdc commit 7f58bc6
Show file tree
Hide file tree
Showing 2 changed files with 218 additions and 2 deletions.
214 changes: 213 additions & 1 deletion components/analytics/grafana/dashboards/all_events.json
Expand Up @@ -297,6 +297,218 @@
],
"title": "All events",
"type": "table"
},
{
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "PDEE91DDB90597936"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": false,
"axisLabel": "",
"axisPlacement": "auto",
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 0,
"scaleDistribution": {
"type": "linear"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 12,
"x": 0,
"y": 30
},
"id": 6,
"options": {
"barRadius": 0,
"barWidth": 0.51,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"orientation": "horizontal",
"showValue": "always",
"stacking": "none",
"tooltip": {
"mode": "single",
"sort": "none"
},
"xField": "browser",
"xTickLabelRotation": 0,
"xTickLabelSpacing": 0
},
"pluginVersion": "9.3.6",
"targets": [
{
"builderOptions": {
"fields": [],
"filters": [],
"limit": 100,
"mode": "list",
"orderBy": [],
"table": "events"
},
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "PDEE91DDB90597936"
},
"format": 1,
"meta": {
"builderOptions": {
"fields": [],
"filters": [],
"limit": 100,
"mode": "list",
"orderBy": [],
"table": "events"
}
},
"queryType": "sql",
"rawSql": "SELECT\r\n browser,\r\n count()\r\nFROM\r\n(\r\n SELECT\r\n concat(JSON_VALUE(payload, '$.platform.name'), ' ', JSON_VALUE(payload, '$.platform.version')) AS browser,\r\n user_id\r\n FROM cvat.events\r\n WHERE $__timeFilter(timestamp) AND (scope = 'load:cvat') AND (browser != ' ')\r\n GROUP BY\r\n user_id,\r\n browser\r\n)\r\nGROUP BY browser\r\nORDER BY count() DESC",
"refId": "A"
}
],
"title": "Browser",
"type": "barchart"
},
{
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "PDEE91DDB90597936"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisGridShow": false,
"axisLabel": "",
"axisPlacement": "auto",
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 0,
"scaleDistribution": {
"type": "linear"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 12,
"x": 12,
"y": 30
},
"id": 8,
"options": {
"barRadius": 0,
"barWidth": 0.51,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"orientation": "horizontal",
"showValue": "always",
"stacking": "none",
"tooltip": {
"mode": "single",
"sort": "none"
},
"xField": "os",
"xTickLabelRotation": 0,
"xTickLabelSpacing": 0
},
"pluginVersion": "9.3.6",
"targets": [
{
"builderOptions": {
"fields": [],
"filters": [],
"limit": 100,
"mode": "list",
"orderBy": [],
"table": "events"
},
"datasource": {
"type": "grafana-clickhouse-datasource",
"uid": "PDEE91DDB90597936"
},
"format": 1,
"meta": {
"builderOptions": {
"fields": [],
"filters": [],
"limit": 100,
"mode": "list",
"orderBy": [],
"table": "events"
}
},
"queryType": "sql",
"rawSql": "SELECT\r\n os,\r\n count()\r\nFROM\r\n(\r\n SELECT\r\n JSON_VALUE(payload, '$.platform.os') AS os,\r\n user_id\r\n FROM cvat.events\r\n WHERE $__timeFilter(timestamp) AND (scope = 'load:cvat') AND (os != '')\r\n GROUP BY\r\n user_id,\r\n os\r\n)\r\nGROUP BY os\r\nORDER BY count() DESC",
"refId": "A"
}
],
"title": "OS",
"type": "barchart"
}
],
"refresh": false,
Expand Down Expand Up @@ -518,6 +730,6 @@
"timezone": "",
"title": "All events",
"uid": "EIGSTDAVz",
"version": 3,
"version": 1,
"weekStart": ""
}
6 changes: 5 additions & 1 deletion cvat-ui/src/utils/controls-logger.ts
Expand Up @@ -5,6 +5,7 @@
import { getCore } from 'cvat-core-wrapper';
import { LogType } from 'cvat-logger';
import config from 'config';
import { platformInfo } from 'utils/platform-checker';

const core = getCore();
const { CONTROLS_LOGS_INTERVAL } = config;
Expand All @@ -16,7 +17,10 @@ class EventRecorder {
#savingInterval: number | null;
public constructor() {
this.#savingInterval = null;
core.logger.log(LogType.loadTool, { location: window.location.pathname + window.location.search });
core.logger.log(LogType.loadTool, {
location: window.location.pathname + window.location.search,
platform: platformInfo(),
});
}

public log(event: MouseEvent): void {
Expand Down

0 comments on commit 7f58bc6

Please sign in to comment.