Skip to content

Logging benchmark test #566

@aregtech

Description

@aregtech

Description:

In order to check the integrated logging system, it is very useful to create configurable logging benchmark test.

The core goal:

  1. Measure logging overhead per entry under various conditions.
  2. Verify thread safety and consistency under concurrency.
  3. Compare performance across formats (light → heavy).
  4. Test scalability with increasing threads and logging frequency.

Log Message Complexity
These logging cases should be fixed in functions, the configuration should be done via parameters (number of loops, for example, etc.)

Case ID Description Example
1. Test pure scope (no log message) LOG_SCOPE(test_log_speed)
2. Pure string LOG_DBG("Hello World")
3. 1 argument LOG_DBG("Value = %d", num1)
4. 2 arguments LOG_DBG("Key = %d, Value = %d", key, val)
5. 3 mixed arguments (mixed type) LOG_DBG("Name = %s, Key = %u, Value = %.2f", name, key, val)
6. 10 mixed arguments (stress test) LOG_DBG("Name = %s, Key = %u, Value = %u, dummy = %.2f, ....)
7. Test with long string (300 - 400 chars, log msg limit is 330 chars) LOG_DBG("long string: %s", str)

Thread Count Scaling
Test logging under increasing thread counts: 1 thread, 2 threads, 4 threads, 8 threads, 16 threads
All threads should call same methods.

Loop Count
Call methods minimum in 1000 loops, maximum 100 000

Logging modes:

  • Asynchronous logging (AREG logging system supports only asynchronous logging)
  • Save logs in the plain text
  • Save logs in the database
  • Save logs on log collector (forward to Lusan)

If possible, simulate real world simulation: Mix logging + dummy work to simulate CPU load

Configuration:
The benchmark test application can be a console application. The parameters can be received from command line of console application something like: -t=8 -l=10000 -a=4 -af=2 -ad=1 -as=1 -sl=32 -s=collect
which means:

  1. -t=8 -- maximum number of thread 8 (min value 1, max value 16)
  2. `-l=10000" -- number of loops 10000 (min value 1.000, maximum value 100.000)
  3. -a=4 -- maximum numbers of arguments 4 (in this example, 2 digits with floating points, 1 integer digit, 1 string with the length 32 characters)
  4. -af=2 -- maximum number of arguments with floating points
  5. -ad=1 -- maximum number of arguments with integer numbers
  6. -as=1 -- maximum number of arguments with string
  7. -sl=32 -- maximum length of strings
  8. -s=collect -- send logs to log collector.

The default values should be:

Case Option Description Default value Maximum value Possible values
1. -t Number of threads 8 16 1, 2, 4, 8, 16
2. -l Number of loops 10.000 100.000 1.000 ... 100.000
3. -a Maximum number of arguments to log 8 12 1 ... 12
4. -af Number of floating point digits arguments 2 value of -a 0 ... 12
5. -ad Number of with integer number arguments 4 value of -a 0 ... 12
6. -as Number of string arguments 2 value of -a 0 ... 12
7. -sl Length of strings 16 64 4 ... 64
8. -s The system to save logs collect all file, db, collect, `all

Default values:

  1. maximum number of threads: 8 (1, 2, 4, 8)
  2. maximum number of loops: 10.000 loops per test case
  3. maximum number of arguments: 8, where there will be 4 integers, 2 digits with floating point and 2 strings with the length 32 characters
  4. save logs on log collector (possible values for option -s are file (save as plain text), db (save in database), collect (send to log collector), all (save on all possible targets: file, db and log collector).

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions