Skip to content

Commit

Permalink
quick fix for issue dedis#25
Browse files Browse the repository at this point in the history
only 'err' with "unable to get good data" if the platform is deterlab
(on localhost the monitor won't start and returns empty RunStats{})
  • Loading branch information
liamsi committed Oct 7, 2015
1 parent 19d79b6 commit 16eb2cd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ package main

import (
"bufio"
"errors"
"flag"
"fmt"
"github.com/BurntSushi/toml"
log "github.com/Sirupsen/logrus"
"github.com/dedis/cothority/deploy/platform"
dbg "github.com/dedis/cothority/lib/debug_lvl"
"math"
"os"
"path/filepath"
"strconv"
"strings"

"github.com/BurntSushi/toml"
log "github.com/Sirupsen/logrus"
"github.com/dedis/cothority/deploy/platform"
dbg "github.com/dedis/cothority/lib/debug_lvl"
)

// Configuration-variables
Expand Down Expand Up @@ -150,8 +150,8 @@ func RunTest(rc platform.RunConfig) (RunStats, error) {
// timeout the command if it takes too long
select {
case <-done:
if isZero(rs.MinTime) || isZero(rs.MaxTime) || isZero(rs.AvgTime) || math.IsNaN(rs.Rate) || math.IsInf(rs.Rate, 0) {
return rs, errors.New(fmt.Sprintf("unable to get good data: %+v", rs))
if platform_dst == "deterlab" && (isZero(rs.MinTime) || isZero(rs.MaxTime) || isZero(rs.AvgTime) || math.IsNaN(rs.Rate) || math.IsInf(rs.Rate, 0)) {
return rs, fmt.Errorf("unable to get good data: %+v", rs)
}
return rs, nil
}
Expand All @@ -170,7 +170,7 @@ func (s *stats) InitStats(name string, runconfigs []platform.RunConfig) {
s.runconfigs = runconfigs
s.rs = make([]RunStats, len(runconfigs))
MkTestDir()
s.file, err = os.OpenFile(TestFile(name), os.O_CREATE | os.O_RDWR | os.O_TRUNC, 0660)
s.file, err = os.OpenFile(TestFile(name), os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0660)
if err != nil {
log.Fatal("error opening test file:", err)
}
Expand Down Expand Up @@ -203,8 +203,8 @@ func (s *stats) WriteStats(run int, runs []RunStats) {

MkTestDir()
cl, err := os.OpenFile(
TestFile("client_latency_" + s.name + "_" + strconv.Itoa(run)),
os.O_CREATE | os.O_RDWR | os.O_TRUNC, 0660)
TestFile("client_latency_"+s.name+"_"+strconv.Itoa(run)),
os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0660)
if err != nil {
log.Fatal("error opening test file:", err)
}
Expand Down

0 comments on commit 16eb2cd

Please sign in to comment.