Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from cloudflare/louis/fix-nanosec-div
Browse files Browse the repository at this point in the history
Fix nanosecond division
  • Loading branch information
lspgn authored Feb 20, 2019
2 parents 13cf7f4 + ed26a6b commit 05a45c1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cmd/octorpki/octorpki.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ var (
RRDPMode = flag.Int("rrdp.mode", RRDP_MATCH_RSYNC, fmt.Sprintf("RRDP security mode (%v = no check, %v = match rsync domain, %v = match path)",
RRDP_NO_MATCH, RRDP_MATCH_RSYNC, RRDP_MATCH_STRICT))

Mode = flag.String("mode", "server", "Select output mode (server/oneoff")
Mode = flag.String("mode", "server", "Select output mode (server/oneoff)")
WaitStable = flag.Bool("output.wait", true, "Wait until stable state to create the file (returns 503 when unstable on HTTP)")

// Serving Options
Addr = flag.String("http.addr", ":8080", "Listening address")
CacheHeader = flag.Bool("http.cache", true, "Enable cache header")
MetricsPath = flag.String("http.metrics", "/metrics", "Prometheus metrics endpoint")
InfoPath = flag.String("http.info", "/infos", "Information URL")
CorsOrigins = flag.String("cors.origins", "*", "Cors origins separated by comma")
CorsCreds = flag.Bool("cors.creds", false, "Cors enable credentials")
Addr = flag.String("http.addr", ":8080", "Listening address")
CacheHeader = flag.Bool("http.cache", true, "Enable cache header")
MetricsPath = flag.String("http.metrics", "/metrics", "Prometheus metrics endpoint")
InfoPath = flag.String("http.info", "/infos", "Information URL")
CorsOrigins = flag.String("cors.origins", "*", "Cors origins separated by comma")
CorsCreds = flag.Bool("cors.creds", false, "Cors enable credentials")

// File option
Output = flag.String("output.roa", "/output.json", "Output ROA file or URL")
Expand Down Expand Up @@ -391,7 +391,7 @@ func (s *state) MainRRDP() {

tmpStats = s.RRDPStats[vv]
tmpStats.Errors++
tmpStats.LastFetchError = int(time.Now().UTC().UnixNano() / 100000000)
tmpStats.LastFetchError = int(time.Now().UTC().UnixNano() / 1000000000)
tmpStats.LastError = fmt.Sprint(err)
tmpStats.Duration = t2.Sub(t1).Seconds()
s.RRDPStats[vv] = tmpStats
Expand All @@ -401,7 +401,7 @@ func (s *state) MainRRDP() {
prometheus.Labels{
"address": vv,
}).Set(float64(rrdp.Serial))
lastFetch := time.Now().UTC().UnixNano() / 100000000
lastFetch := time.Now().UTC().UnixNano() / 1000000000
MetricLastFetch.With(
prometheus.Labels{
"address": vv,
Expand Down Expand Up @@ -462,7 +462,7 @@ func (s *state) MainRsync() {

tmpStats = s.RsyncStats[v]
tmpStats.Errors++
tmpStats.LastFetchError = int(time.Now().UTC().UnixNano() / 100000000)
tmpStats.LastFetchError = int(time.Now().UTC().UnixNano() / 1000000000)
tmpStats.LastError = fmt.Sprint(err)
s.RsyncStats[v] = tmpStats
}
Expand Down

0 comments on commit 05a45c1

Please sign in to comment.