Skip to content

Commit c52f6ec

Browse files
committed
add README
1 parent b6975cd commit c52f6ec

File tree

4 files changed

+46
-7
lines changed

4 files changed

+46
-7
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# What is summarize?
2+
Summarizer gives you Summary about stream of integers and it updates the summary every specified interval.
3+
![example.gif](example.gif)
4+
5+
# Installation
6+
```bash
7+
curl
8+
```
9+
# Usage
10+
to summarize numbers from standard input:
11+
```bash
12+
summarizer
13+
```
14+
15+
to summarize numbers from file:
16+
```bash
17+
summarizer -f file_name
18+
```
19+
20+
other options:
21+
```
22+
-h [ --help ] Produce help message
23+
-f [ --file ] arg Eead input from a file
24+
-d [ --delay ] arg (=1) Delay time between re-calculating
25+
-p [ --precision ] arg (=2) Control the precision parameter
26+
```
27+
28+
# Common Usage
29+
Usally you won't get a stream of numbers in you logs, you will need to precess the logs first to extract the numers you want only
30+
assume that `./generate` produce this logs:
31+
```
32+
the request took 383 seconds to complete
33+
the request took 886 seconds to complete
34+
the request took 777 seconds to complete
35+
```
36+
you can use `awk` first then pass the resut to `summarize`
37+
```bash
38+
./generator | awk -W interactive '{print $4}' | ./summarize
39+
```

example.gif

23.1 KB
Loading

main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ int main(int ac, char *av[])
6262
{
6363
po::options_description desc("Allowed options");
6464
desc.add_options()
65-
("help,h", "produce help message")
66-
("file,f", po::value<string>(), "read input from a file")
67-
("delay,d", po::value<int>(&delay)->default_value(1), "delay time between re-calculating")
68-
("precision,p", po::value<int>(&precision)->default_value(2), "control the precision parameter")
65+
("help,h", "Produce help message")
66+
("file,f", po::value<string>(), "Eead input from a file")
67+
("delay,d", po::value<int>(&delay)->default_value(1), "Delay time between re-calculating")
68+
("precision,p", po::value<int>(&precision)->default_value(2), "Control the precision parameter")
6969
;
7070

7171
po::positional_options_description p;
@@ -78,8 +78,8 @@ int main(int ac, char *av[])
7878

7979
if (vm.count("help"))
8080
{
81-
cout << "summarizer - Summarize a stream of numbers by printing some aggregation functions every specified interval\n";
82-
cout << "Usage: summarizer [file_name] [options]\n";
81+
cout << "summarize - Summarize a stream of numbers by printing some aggregation functions every specified interval\n";
82+
cout << "Usage: summarize [file_name] [options]\n";
8383
cout << desc << "\n";
8484
return 0;
8585
}

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ all:
22
c++ \
33
-std=c++11 \
44
-pthread \
5-
-o summarizer \
5+
-o summarize \
66
main.cpp utils/utils.cpp modules/summarizer.cpp \
77
-lboost_program_options

0 commit comments

Comments
 (0)