fix: address release review follow-ups for #169

This commit is contained in:
n30nex
2026-09-30 07:19:02 -04:00
committed by MrAlders0n
parent d3c330e8fb
commit dea5395783
5 changed files with 6 additions and 11 deletions
+1 -4
View File
@@ -321,10 +321,7 @@ func (s *Store) GetObserverActivity(ctx context.Context, observerID uuid.UUID, w
}
activity.PayloadTypes = make([]api.PayloadBreakdownItem, 0, len(typeRows))
for _, v := range typeRows {
payloadType := int16(-1)
if v.PayloadType != nil {
payloadType = *v.PayloadType
}
payloadType := v.PayloadType
activity.PayloadTypes = append(activity.PayloadTypes, api.PayloadBreakdownItem{
PayloadType: payloadType,
PayloadTypeName: api.PayloadTypeName(payloadType),
+2 -2
View File
@@ -32,7 +32,7 @@ type AnalyticsLiveHourlyIataStat struct {
type AnalyticsLiveObserverActivityHourly struct {
ObserverID uuid.UUID `json:"observer_id"`
PayloadType *int16 `json:"payload_type"`
PayloadType int16 `json:"payload_type"`
Bucket pgtype.Timestamptz `json:"bucket"`
Observations int64 `json:"observations"`
AirtimeMs float32 `json:"airtime_ms"`
@@ -244,7 +244,7 @@ type MvHourlyIataStat struct {
type MvObserverActivityHourly struct {
ObserverID uuid.UUID `json:"observer_id"`
PayloadType *int16 `json:"payload_type"`
PayloadType int16 `json:"payload_type"`
Bucket pgtype.Timestamptz `json:"bucket"`
Observations int64 `json:"observations"`
AirtimeMs float32 `json:"airtime_ms"`
+2 -2
View File
@@ -725,8 +725,8 @@ type GetObserverActivityHourlyPayloadTypesParams struct {
}
type GetObserverActivityHourlyPayloadTypesRow struct {
PayloadType *int16 `json:"payload_type"`
Count int64 `json:"count"`
PayloadType int16 `json:"payload_type"`
Count int64 `json:"count"`
}
func (q *Queries) GetObserverActivityHourlyPayloadTypes(ctx context.Context, arg GetObserverActivityHourlyPayloadTypesParams) ([]GetObserverActivityHourlyPayloadTypesRow, error) {
+1 -1
View File
@@ -256,7 +256,7 @@ var activityIntervals = map[string]time.Duration{
// @Param observerId path string true "Observer UUID"
// @Param range query string false "Trailing window as a Go duration, max 720h (default 24h); max 48h when interval is under 1h"
// @Param interval query string false "Bucket size: 5m, 15m, 1h, 6h or 24h (default 15m)"
// @Param until query int false "Optional exclusive end in epoch milliseconds; aligned down to a complete bucket, at most 30 days old"
// @Param until query int false "Optional exclusive end in epoch milliseconds; aligned down to a complete bucket, at most 30 days old. Activity uses this window; summary freshness/latestRecordedAt and the last complete hour are measured at response generation time, independently of until."
// @Success 200 {object} api.ObserverActivity
// @Failure 400 {object} handlers.APIError
// @Failure 404 {object} handlers.APIError
-2
View File
@@ -31,5 +31,3 @@ sql:
- column: "mv_top_advertisers_by_iata.name"
go_type: {type: "string", pointer: true}
- column: "mv_observer_activity_hourly.payload_type"
go_type: {type: "int16", pointer: true}