From ba0616c39cc55597327eaee0e3036301d60fc45a Mon Sep 17 00:00:00 2001 From: Markus Grüneis Date: Sat, 29 Nov 2014 18:56:57 +0100 Subject: hub: store duration in milliseconds --- src/hub/src/spreadspace.org/sfive/s5store.go | 2 +- src/hub/src/spreadspace.org/sfive/s5store_test.go | 4 ++-- src/hub/src/spreadspace.org/sfive/s5typesStore.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/hub') diff --git a/src/hub/src/spreadspace.org/sfive/s5store.go b/src/hub/src/spreadspace.org/sfive/s5store.go index ef5be34..3fbcf39 100644 --- a/src/hub/src/spreadspace.org/sfive/s5store.go +++ b/src/hub/src/spreadspace.org/sfive/s5store.go @@ -51,7 +51,7 @@ func dataUpdateFromStatisticsData(value StatisticsData) dataUpdateDb { value.SourceHubUuid, value.SourceHubDataUpdateId, value.StartTime.Unix(), - int64(value.Duration / 1000), + value.Duration, value.Data.ClientCount, value.Data.BytesReceived, value.Data.BytesSent} diff --git a/src/hub/src/spreadspace.org/sfive/s5store_test.go b/src/hub/src/spreadspace.org/sfive/s5store_test.go index d8e831d..72ef930 100644 --- a/src/hub/src/spreadspace.org/sfive/s5store_test.go +++ b/src/hub/src/spreadspace.org/sfive/s5store_test.go @@ -14,7 +14,7 @@ func TestAppend(t *testing.T) { defer store.Close() startTime := time.Date(2014, time.August, 24, 14, 35, 33, 847282000, time.UTC) - update := DataUpdate{Data: SourceData{BytesSent: 1, ClientCount: 3, BytesReceived: 1}, StartTime: startTime, Duration: 5} + update := DataUpdate{Data: SourceData{BytesSent: 1, ClientCount: 3, BytesReceived: 1}, StartTime: startTime, Duration: 5000} streamId := StreamId{ContentId: "content", Format: "7bitascii", Quality: QualityHigh} source := SourceId{Hostname: "localhost", Tags: []string{"tag1", "master"}, StreamId: streamId, Version: 1} dat := StatisticsData{nil, nil, source, update} @@ -75,7 +75,7 @@ func TestGetUpdatesAfter(t *testing.T) { defer store.Close() startTime := time.Date(2014, time.August, 24, 14, 35, 33, 847282000, time.UTC) - update := DataUpdate{Data: SourceData{BytesSent: 1, ClientCount: 3, BytesReceived: 1}, StartTime: startTime, Duration: 5} + update := DataUpdate{Data: SourceData{BytesSent: 1, ClientCount: 3, BytesReceived: 1}, StartTime: startTime, Duration: 5000} streamId := StreamId{ContentId: "content", Format: "7bitascii", Quality: QualityHigh} source := SourceId{Hostname: "localhost", Tags: []string{"tag1", "master"}, StreamId: streamId, Version: 1} dat := StatisticsData{nil, nil, source, update} diff --git a/src/hub/src/spreadspace.org/sfive/s5typesStore.go b/src/hub/src/spreadspace.org/sfive/s5typesStore.go index 7ee5bce..f06e953 100644 --- a/src/hub/src/spreadspace.org/sfive/s5typesStore.go +++ b/src/hub/src/spreadspace.org/sfive/s5typesStore.go @@ -58,7 +58,7 @@ type dataUpdateDb struct { SourceHubUuid *string SourceHubDataUpdateId *int StartTime int64 // time.Time - Duration int64 // time.Duration + Duration int64 // duration in milliseconds ClientCount uint BytesReceived uint BytesSent uint -- cgit v1.2.3