You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ne...@apache.org on 2017/01/13 23:36:00 UTC
[04/29] incubator-trafficcontrol git commit: When using iota in a
cons() block, it need only be called once
When using iota in a cons() block, it need only be called once
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/9d913ed0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/9d913ed0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/9d913ed0
Branch: refs/heads/master
Commit: 9d913ed04837a6f2efec5a383b7dc5334b893f7a
Parents: f7061c1
Author: sbogacz <sb...@zvelo.com>
Authored: Sat Jan 7 00:16:34 2017 -0700
Committer: David Neuman <da...@gmail.com>
Committed: Fri Jan 13 23:33:56 2017 +0000
----------------------------------------------------------------------
.../influxdb_tools/sync/sync_ts_databases.go | 1 +
traffic_stats/traffic_stats.go | 4 +--
traffic_stats/traffic_stats_test.go | 34 ++++++++++++++++++++
3 files changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9d913ed0/traffic_stats/influxdb_tools/sync/sync_ts_databases.go
----------------------------------------------------------------------
diff --git a/traffic_stats/influxdb_tools/sync/sync_ts_databases.go b/traffic_stats/influxdb_tools/sync/sync_ts_databases.go
index 02a8249..00cd13b 100644
--- a/traffic_stats/influxdb_tools/sync/sync_ts_databases.go
+++ b/traffic_stats/influxdb_tools/sync/sync_ts_databases.go
@@ -50,6 +50,7 @@ type deliveryServiceStats struct {
deliveryService string
cacheGroup string
}
+
type dailyStats struct {
t string //time
cdn string
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9d913ed0/traffic_stats/traffic_stats.go
----------------------------------------------------------------------
diff --git a/traffic_stats/traffic_stats.go b/traffic_stats/traffic_stats.go
index 4f720c1..18419ca 100644
--- a/traffic_stats/traffic_stats.go
+++ b/traffic_stats/traffic_stats.go
@@ -44,9 +44,9 @@ const (
// FATAL will exit after printing error
FATAL = iota
// ERROR will just keep going, print error
- ERROR = iota
+ ERROR
// WARN will keep going and print a warning
- WARN = iota
+ WARN
)
const (
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9d913ed0/traffic_stats/traffic_stats_test.go
----------------------------------------------------------------------
diff --git a/traffic_stats/traffic_stats_test.go b/traffic_stats/traffic_stats_test.go
new file mode 100644
index 0000000..02a387d
--- /dev/null
+++ b/traffic_stats/traffic_stats_test.go
@@ -0,0 +1,34 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+package main
+
+import (
+ "testing"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+func TestMain(t *testing.T) {
+ Convey("Constants should be right", t, func() {
+ So(FATAL, ShouldEqual, 0)
+ So(ERROR, ShouldEqual, 1)
+ So(WARN, ShouldEqual, 2)
+ })
+}