mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-10-16 20:20:07 +00:00
fix: address release review follow-ups for #169
This commit is contained in:
+1
-4
@@ -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
@@ -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"`
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user