Skip to content

Commit

Permalink
Merge pull request #44 from WoSai/hotfix/v2.4.5
Browse files Browse the repository at this point in the history
v2.4.5
  • Loading branch information
jacexh authored Jun 20, 2022
2 parents e01dfb1 + c486771 commit 882d094
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 28 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

## v2.4.5

- Convert the type of `ultron_attacker_failures_total` and `ultron_attacker_requests_total` to [Counter](https://prometheus.io/docs/concepts/metric_types/#counter)

## v2.4.2

- now you can change name, level, etc. of log file via an external config file: `./config.yml`
Expand Down
22 changes: 0 additions & 22 deletions example/benchmark/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,4 @@ func main() {
}

select {}

// for {
// if plan.Status() == ultron.StatusFinished {
// <-time.After(1 * time.Second)
// break
// }
// runtime.Gosched()
// }

// plan = ultron.NewPlan("benchmark-test-2")
// plan.AddStages(
// &ultron.V1StageConfig{ConcurrentUsers: 150, Duration: 60 * time.Second, RampUpPeriod: 10},
// )
// runner.StartPlan(plan)

// for {
// if plan.Status() == ultron.StatusFinished {
// <-time.After(1 * time.Second)
// break
// }
// runtime.Gosched()
// }
}
3 changes: 1 addition & 2 deletions example/localrunner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ func main() {
}

// open http://localhost:2017
block := make(chan struct{}, 1)
<-block
select {}
}
4 changes: 2 additions & 2 deletions example/slave/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ func main() {
if err := slave.Connect("127.0.0.1:2021", grpc.WithInsecure()); err != nil {
panic(err)
}
block := make(chan struct{}, 1)
<-block

select {}
}
4 changes: 2 additions & 2 deletions metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func (m *metric) Collect(ch chan<- prometheus.Metric) {
}

for _, report := range report.Reports {
ch <- prometheus.MustNewConstMetric(descTotalRequests, prometheus.GaugeValue, float64(report.Requests), report.Name, plan)
ch <- prometheus.MustNewConstMetric(descTotalFailures, prometheus.GaugeValue, float64(report.Failures), report.Name, plan)
ch <- prometheus.MustNewConstMetric(descTotalRequests, prometheus.CounterValue, float64(report.Requests), report.Name, plan)
ch <- prometheus.MustNewConstMetric(descTotalFailures, prometheus.CounterValue, float64(report.Failures), report.Name, plan)
ch <- prometheus.MustNewConstMetric(descMinResponseTime, prometheus.GaugeValue, float64(report.Min.Milliseconds()), report.Name, plan)
ch <- prometheus.MustNewConstMetric(descMaxResponseTime, prometheus.GaugeValue, float64(report.Max.Milliseconds()), report.Name, plan)
ch <- prometheus.MustNewConstMetric(descAvgResponseTime, prometheus.GaugeValue, float64(report.Average.Milliseconds()), report.Name, plan)
Expand Down

0 comments on commit 882d094

Please sign in to comment.