add http server
This commit is contained in:
@ -69,17 +69,17 @@ func (s deviceStatsDB) asDomain() entities.DeviceStatistics {
|
||||
}
|
||||
}
|
||||
|
||||
func (r statsRepository) Upsert(ctx context.Context, id entities.DeviceID, stats entities.DeviceStatistics) error {
|
||||
func (r statsRepository) Upsert(ctx context.Context, stats entities.DeviceStatistics) error {
|
||||
opts := options.Update().SetUpsert(true)
|
||||
|
||||
filter := bson.D{
|
||||
{
|
||||
Key: "_id",
|
||||
Value: id,
|
||||
Value: stats.ID,
|
||||
},
|
||||
}
|
||||
document := deviceStatsDB{
|
||||
DeviceID: string(id),
|
||||
DeviceID: string(stats.ID),
|
||||
IncomingTraffic: stats.IncomingTrafficBytes,
|
||||
OutgoinfTraffic: stats.OutgoingTrafficBytes,
|
||||
IncomingRPS: stats.IncomingRPS,
|
||||
|
||||
Reference in New Issue
Block a user