Skip to content

Commit

Permalink
2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
psemiletov committed Feb 24, 2023
1 parent 8c8840b commit 0df72d2
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 87 deletions.
10 changes: 2 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ set (CMAKE_CXX_STANDARD 17)
option(USE_PROMCPP "Use prometheus_cpp" OFF)
option(USE_STATIC "Static build" OFF)
option(USE_CLANG "Build with Clang" OFF)
option(USE_OPENSUSE "Build with OpenSUSE" OFF)
#option(USE_OPENSUSE "Build with OpenSUSE" OFF)


function( set_required_build_settings_for_GCC8 )
# Always link with libstdc++fs.a when using GCC 8.
# Note: This command makes sure that this option comes pretty late on the cmdline.
link_libraries( "$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:-lstdc++fs>" )
endfunction()


if(USE_CLANG)
set(CMAKE_CXX_COMPILER clang++)
Expand All @@ -23,7 +17,7 @@ endif(USE_CLANG)



project (logfilegen VERSION 2.0.0 LANGUAGES CXX)
project (logfilegen VERSION 2.1.0 LANGUAGES CXX)
add_definitions(-DVERSION_NUMBER="\\"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}\\"")


Expand Down
6 changes: 5 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
+ OpenSUSE 15.15 compat (cmake -DUSE_OPENSUSE=ON)
+ outdated GCC (< 9.1.0) support
* console possibly overflow fixes
* ENV variables now in the UPPER CASE only


+ --metrics
+ --results
+ --results_template
Expand Down
9 changes: 4 additions & 5 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
+ Metrics support. logfilegen can expose metrics, turned on by default. Get the metrics in Prometheus format at localhost:8080/metrics, and see the self-hosted statistics page at localhost:8080 (via http).
+ Results support. logfilegen can write final statistics to the file or stdout (--results=filename), in a given format (--resuilts_string=format string).
* Cmake support improvements (Clang, static build, etc).
* A lot of fixes.
* Documentation update.
+ outdated GCC (< 9.1.0) support (CMake)
* console possibly overflow fixes
* ENV variables now in the UPPER CASE only
* CMake is preferrable way to build logfilegen
2 changes: 1 addition & 1 deletion cycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


#ifdef _WIN32
#include <conio.h>
#define clrscr() system("cls")
#else
#include <stdio.h>
#define clrscr() printf("\e[1;1H\e[2J")
Expand Down
11 changes: 5 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ Logfilegen is a fast and highly customizable tool to generate common server (ngi

## NEWS

***22 february 2023, 2.0.0***
***24 february 2023, 2.1.0***

+ Metrics support. logfilegen can expose metrics, turned on by default. Get the metrics in Prometheus format at localhost:8080/metrics, and see the self-hosted statistics page at localhost:8080 (via http).
+ outdated GCC (< 9.1.0) support (CMake)

+ Results support. logfilegen can write final statistics to the file or stdout (--results=filename), in a given format (--resuilts_string=format string).
* console possibly overflow fixes

* Cmake support improvements (Clang, static build, etc).
* ENV variables now in the UPPER CASE only

* A lot of fixes.
* CMake is preferrable way to build logfilegen

* Documentation update.


## MANUAL
Expand Down
120 changes: 57 additions & 63 deletions docs/inst.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,85 @@
## Installation

### From the source with plain Make
To compile logfilegen from the source you need GCC/g++ or Clang with C++17 version support. If you did not compiled programs before, install GCC/g++ or Clang, **cmake** and **make** utility to your system.

To compile logfilegen from the source you need GCC/g++ or Clang with C++17 version support. If you did not compiled programs before, install g++ or Clang, and **make** utility to your system.
Use the tarball with the [latest release](https://github.com/psemiletov/logfilegen/releases/latest), it is always stable. Altough logfilegen has several manually written makefiles, the prefered way to compile logfilegen is CMake/make pair. For example, with CMake you can compile logfilegen with outdated GCC versions, or easily use Clang instead of GCC.

logfilegen has support for Prometheus/OpenMetrics format metrics exposion via built-in server code or, as an optional and experimatal feature, via [prometheus-cpp](https://github.com/jupp0r/prometheus-cpp) library. See the CMake section for turning the last one on, but currently the built-in server code works faster.

First of all, download the tarball from [latest release](https://github.com/psemiletov/logfilegen/releases/latest), unpack it, and, if you are already familiar with compilation tools, go to the logfilegen source dir, and, as root or with sudo, run:
### Build the source with CMake/Make

```console
Unpack the source, go to the logfilegen source dir, and, as root or with sudo, run:


#### Default, build with GCC


```
mkdir b
cd b
cmake ..
make
make install
```

And to uninstall:
#### Default, build with Clang++


```console
make uninstall
```
mkdir b
cd b
cmake -DUSE_CLANG ..
make
make install
```

There are some ready-to-use examples below to build logfilegen on some systems or distros:
#### Static build


#### OpenSUSE 15.15
```
mkdir b
cd b
cmake -DUSE_STATIC=ON ..
make
make install
```

- Download and unpack the tarball. Go to the unpacked source directory.

- Install dependencies.
#### With prometheus_cpp support

- Build and install:
logfilegen has support for Prometheus/OpenMetrics format metrics exposion via built-in server code or, as an optional and experimatal feature, via [prometheus-cpp](https://github.com/jupp0r/prometheus-cpp) library. Currently, the built-in server code works faster. But if you want to play around with prometheus_cpp:

```console

```
mkdir b
cd b
cmake -DUSE_SUSE=ON
cmake -DUSE_PROMCPP=ON ..
make
make install
```



### From the source with plain Make


More simple, but less powerful and less flexlible way to compile logfilegen, is the use on manual written Makefiles:


```console
make
make install
```

And to uninstall:

```console
make uninstall
```

There are some ready-to-use examples below to build logfilegen with Makefiles on some systems or distros:



#### Ubuntu 22.04

- Download and unpack the tarball. Go to the unpacked source directory.
Expand Down Expand Up @@ -93,54 +135,6 @@ make install
```


### From the source with CMake/Make


#### Default, build with GCC


```
mkdir b
cd b
cmake ..
make
make install
```

#### Default, build with Clang++


```
mkdir b
cd b
cmake -DUSE_CLANG ..
make
make install
```

#### Static build


```
mkdir b
cd b
cmake -DUSE_STATIC=ON ..
make
make install
```


#### With prometheus_cpp support


```
mkdir b
cd b
cmake -DUSE_PROMCPP=ON ..
make
make install
```


### READ MORE

Expand Down
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* this code by Peter Semiletov is Public Domain *
**********************************************************/

#undef _HAS_STD_BYTE
//#undef _HAS_STD_BYTE

#include <cstdint>
#include <cstdlib>
Expand Down Expand Up @@ -33,7 +33,7 @@


#ifndef VERSION_NUMBER
#define VERSION_NUMBER "2.0.0"
#define VERSION_NUMBER "2.1.0"
#endif


Expand Down
2 changes: 1 addition & 1 deletion pairfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ CPairFile::CPairFile (vector <string> envars)

values[param] = value;

std::cout << "param: " << param << " value: " << value << endl;
// std::cout << "param: " << param << " value: " << value << endl;
}
}
/*
Expand Down

0 comments on commit 0df72d2

Please sign in to comment.