feat(analyticsApi): added success_count to initAggregateCount
Build and Push Docker image / build-and-push (push) Successful in 2m13s
Details
Build and Push Docker image / build-and-push (push) Successful in 2m13s
Details
This commit is contained in:
parent
adc60e9960
commit
7b8316fbe3
|
@ -223,27 +223,27 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) {
|
|||
//
|
||||
// {
|
||||
// "device_type": [
|
||||
// { "value": "<device type>", "count": <session count>, "error_count": <error count> },
|
||||
// { "value": "<device type>", "count": <session count>, "error_count": <error count>, "success_count": <success count> },
|
||||
// ...
|
||||
// ],
|
||||
// "browser_name": [
|
||||
// { "value": "<browser name>", "count": <session count>, "error_count": <error count> },
|
||||
// { "value": "<browser name>", "count": <session count>, "error_count": <error count>, "success_count": <success count> },
|
||||
// ...
|
||||
// ],
|
||||
// "operating_system": [
|
||||
// { "value": "<operating system>", "count": <session count>, "error_count": <error count> },
|
||||
// { "value": "<operating system>", "count": <session count>, "error_count": <error count>, "success_count": <success count> },
|
||||
// ...
|
||||
// ],
|
||||
// "user_agent": [
|
||||
// { "value": "<user agent>", "count": <session count>, "error_count": <error count> },
|
||||
// { "value": "<user agent>", "count": <session count>, "error_count": <error count>, "success_count": <success count> },
|
||||
// ...
|
||||
// ],
|
||||
// "geo_country_code": [
|
||||
// { "value": "<country code>", "count": <session count>, "error_count": <error count> },
|
||||
// { "value": "<country code>", "count": <session count>, "error_count": <error count>, "success_count": <success count> },
|
||||
// ...
|
||||
// ],
|
||||
// "preferred_language": [
|
||||
// { "value": "<preferred language>", "count": <session count>, "error_count": <error count> },
|
||||
// { "value": "<preferred language>", "count": <session count>, "error_count": <error count>, "success_count": <success count> },
|
||||
// ...
|
||||
// ]
|
||||
// }
|
||||
|
@ -268,6 +268,7 @@ func initAggregateCount(app *pocketbase.PocketBase, e *core.ServeEvent) {
|
|||
type Data struct {
|
||||
Value string `db:"value" json:"value"`
|
||||
Count int `db:"count" json:"count"`
|
||||
SuccessCount int `db:"success_count" json:"success_count"`
|
||||
ErrorCount int `db:"error_count" json:"error_count"`
|
||||
}
|
||||
|
||||
|
@ -284,6 +285,7 @@ func initAggregateCount(app *pocketbase.PocketBase, e *core.ServeEvent) {
|
|||
SELECT
|
||||
IFNULL(` + field + `, 'N/A') as value,
|
||||
COUNT(id) AS count,
|
||||
SUM(CASE WHEN error IS NULL THEN 1 ELSE 0 END) AS success_count,
|
||||
SUM(CASE WHEN error IS NOT NULL THEN 1 ELSE 0 END) AS error_count
|
||||
FROM analyticsPageViewsWithSessionDetail
|
||||
WHERE created >= {:startDate}
|
||||
|
|
Loading…
Reference in New Issue