kotalco / core-api

Kotal core API
0 stars 0 forks source link

chore/update-endpoints-stats #282

Closed mohamed-abdelrhman closed 1 year ago

mohamed-abdelrhman commented 1 year ago

Issue Description

Background

Currently each endpoint hit stored incrementally in the activity table in the counter field

Requirements

store each hit timestamp

Proposed Changes

change the activity table to the following format

type Activity struct {
    ID         string `gorm:"uniqueIndex"`
    EndpointId string 
    timestamp    int64
}

later we can aggregate the number of hits with the timestamp filed daily, weekly or monthly