Skip to content

Commit

Permalink
rename to tps
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Sep 27, 2022
1 parent 2b279ca commit 71afc16
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ log data-> | main channel(crossbeam) | ->
```
//MACOS(Apple M1MAX-32GB)
Time: 221.079ms ,each:221 ns/op
QPS: 4523139 Iter/s
TPS: 4523139 Iter/s
```

> support Future mode,async await based on mpsc channel, tokio or async_std
Expand Down
2 changes: 1 addition & 1 deletion README_CH.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ log data-> | main channel(crossbeam) | ->
```
//MACOS(Apple M1MAX-32GB)
Time: 221.079ms ,each:221 ns/op
QPS: 4523139 Iter/s
TPS: 4523139 Iter/s
```

> support Future mode,async await based on mpsc channel, tokio or async_std
Expand Down
4 changes: 2 additions & 2 deletions example/src/bench_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use fast_log::appender::{FastLogRecord, LogAppender};
use fast_log::bencher::QPS;
use fast_log::bencher::TPS;
use fast_log::config::Config;
use std::time::Instant;

Expand All @@ -20,5 +20,5 @@ fn main() {
//wait log finish write all
log::logger().flush();
now.time(total);
now.qps(total);
now.tps(total);
}
4 changes: 2 additions & 2 deletions example/src/bench_test_file.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use fast_log::bencher::QPS;
use fast_log::bencher::TPS;
use fast_log::config::Config;
use std::time::Instant;

Expand All @@ -15,5 +15,5 @@ fn main() {
//wait log finish write all
log::logger().flush();
now.time(total);
now.qps(total);
now.tps(total);
}
4 changes: 2 additions & 2 deletions example/src/bench_test_file_split.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use fast_log::bencher::QPS;
use fast_log::bencher::TPS;
use fast_log::config::Config;
use fast_log::consts::LogSize;
use fast_log::plugin::file_split::RollingType;
Expand All @@ -25,5 +25,5 @@ fn main() {
//wait log finish write all
log::logger().flush();
now.time(total);
now.qps(total);
now.tps(total);
}
10 changes: 5 additions & 5 deletions src/bencher.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pub trait QPS {
fn qps(&self, total: u64);
pub trait TPS {
fn tps(&self, total: u64);
fn time(&self, total: u64);
fn cost(&self);
}

impl QPS for std::time::Instant {
fn qps(&self, total: u64) {
impl TPS for std::time::Instant {
fn tps(&self, total: u64) {
let time = self.elapsed();
println!(
"QPS: {} Iter/s",
"TPS: {} Iter/s",
(total as u128 * 1000000000 as u128 / time.as_nanos() as u128)
);
}
Expand Down

0 comments on commit 71afc16

Please sign in to comment.