summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Grüneis <gimpf@gimpf.org>2014-11-29 18:56:57 +0100
committerMarkus Grüneis <gimpf@gimpf.org>2014-11-29 18:56:57 +0100
commitba0616c39cc55597327eaee0e3036301d60fc45a (patch)
tree6dc49b81b3ba61c8a71eadf74676156d69a4ca8b
parenthub: query last-id from elasticsearch in fwd-es (diff)
hub: store duration in milliseconds
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5store.go2
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5store_test.go4
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5typesStore.go2
3 files changed, 4 insertions, 4 deletions
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