Commit f8502ef8 authored by Julius Metz's avatar Julius Metz

add collectl right values tests

parent 5c4f06a6
8EXtu1Q2PeToztR67j4PTJik40PLUpztaryX23cnRUaNoyRS8k9nmvw40LSm5zeRFkoIyi3uFeOcpy3UEKCarItcwYsyasRuCA8FZA0OyP6LNgOU9thW0K2hOcdscK4ETJxSZDr86EeOI5HRHciThLuwWS5tbrGQiGKs7n3G4fGRcX6zgYCRtMDGHclZZKYfsLYEwDTZF6qSq3uOFkvwwMf7ioEz7uap6S6C3EXZkSJXIsW4N3IZHZIeIsTYFx0QvYBV0FmJDbGQwx3V6SHja8hCnhq5e3OJGcbeLAwlpf3g6s8FPh9fKUBmkl8ZIY3mf2o4o95Yt3gCZf1Pj6WpyQVBnup533YeCHELRNN7ZJOKKrZf0h7bSIF6Xm4PzskR1KjRm8Y9XYl2EebBrRhfuruMsN01C2hHNVyXhezDnnrAvoVQsC27KnAtlPBeGqjaJJrez10eQLKWMklFI9oFc90RPzqJD2uL7Ap5nsjkToWQYx87oMxRTLLnYiHLcb4pIroThdXfTW98lFRh9EkmrWXHfGRgB4l1ILDmOWSmVzOUm6wtOdDcgPTyNfVp2ASxObTo4fwWrx5bR4qUHFhIhE4GNbsKNGKor4Jh8U0xQpQgqVkbzyqtPc6sHJq9FDNaaI0m7PFwRDs0yfLzxgLTCC8HICBPbjmxDPm1yVXXa7OYxwRroic5i0lIqlTy1oPhk0WbovGxoiLSLVjFr4DuYlKt7Qra4dx2A2FFIqtU5g37EBiYe975OEI9zRXGhp0m8JvFf5VXvMeAPgg787j5NekDuSnpcFBv7fy6uBDyKSkBlFcF1uP37QrhsgweWxzpkj0XmQbXW78hMARUrP3MP4DoLOsNk33HvBqPLZwZminjxjCYDZWTKLVLyG955RKYQYq0kTd8kTAdLAQBI1G28JtqMK3EbGWEJdu6LSBO8LqRtksuNM5II1LGAtYro3RdvAo24RJAeW4QqY8ERaJISRiWcyXNCdYThpHd5KRama2cHV5Diai3GcuO337uonID
\ No newline at end of file
## Validation of read write and syscall counts of collectl
The validate_read_write_syscalls.cpp is a programm what do following things once per second:
1. writes exactly one kib
2. read exactly one kib
3. And that are exactly 3 read/write syscalls in C++ because:
1 write to file
2 read because the file must be reopened in every loop otherwise it will only do a read command once
And collectl save this correctly!
## Validation of CPU
Test was install "stress" and stress one cpu and the cpu load of stress must be one cpu:
```
stress -c 1
```
In my test the collectl has collect all data right.
## Validation of Memory
Programm validate_ram.cpp Allocate 1GB memory(for double) but C++ need for this more memory so it is not a good way do validate the data of collectl.
But the memory that is shown in htop is the same like in collectl so I assume the values are correct.
\ No newline at end of file
#include <chrono>
#include <thread>
#include <stdlib.h>
#include <iostream>
int main(){
double * a;
a = new double[134217728]{0};
std::chrono::seconds interval( 1 );
for(int i = 0; i < 10; i++) {
std::this_thread::sleep_for( interval );
}
return 0;
}
\ No newline at end of file
#include <chrono>
#include <thread>
#include <iostream>
#include <fstream>
#include <string>
int main(){
std::ofstream f1;
std::ifstream f2;
f1.open("write_trash");
std::string a = "8EXtu1Q2PeToztR67j4PTJik40PLUpztaryX23cnRUaNoyRS8k9nmvw40LSm5zeRFkoIyi3uFeOcpy3UEKCarItcwYsyasRuCA8FZA0OyP6LNgOU9thW0K2hOcdscK4ETJxSZDr86EeOI5HRHciThLuwWS5tbrGQiGKs7n3G4fGRcX6zgYCRtMDGHclZZKYfsLYEwDTZF6qSq3uOFkvwwMf7ioEz7uap6S6C3EXZkSJXIsW4N3IZHZIeIsTYFx0QvYBV0FmJDbGQwx3V6SHja8hCnhq5e3OJGcbeLAwlpf3g6s8FPh9fKUBmkl8ZIY3mf2o4o95Yt3gCZf1Pj6WpyQVBnup533YeCHELRNN7ZJOKKrZf0h7bSIF6Xm4PzskR1KjRm8Y9XYl2EebBrRhfuruMsN01C2hHNVyXhezDnnrAvoVQsC27KnAtlPBeGqjaJJrez10eQLKWMklFI9oFc90RPzqJD2uL7Ap5nsjkToWQYx87oMxRTLLnYiHLcb4pIroThdXfTW98lFRh9EkmrWXHfGRgB4l1ILDmOWSmVzOUm6wtOdDcgPTyNfVp2ASxObTo4fwWrx5bR4qUHFhIhE4GNbsKNGKor4Jh8U0xQpQgqVkbzyqtPc6sHJq9FDNaaI0m7PFwRDs0yfLzxgLTCC8HICBPbjmxDPm1yVXXa7OYxwRroic5i0lIqlTy1oPhk0WbovGxoiLSLVjFr4DuYlKt7Qra4dx2A2FFIqtU5g37EBiYe975OEI9zRXGhp0m8JvFf5VXvMeAPgg787j5NekDuSnpcFBv7fy6uBDyKSkBlFcF1uP37QrhsgweWxzpkj0XmQbXW78hMARUrP3MP4DoLOsNk33HvBqPLZwZminjxjCYDZWTKLVLyG955RKYQYq0kTd8kTAdLAQBI1G28JtqMK3EbGWEJdu6LSBO8LqRtksuNM5II1LGAtYro3RdvAo24RJAeW4QqY8ERaJISRiWcyXNCdYThpHd5KRama2cHV5Diai3GcuO337uonID";
char b[1024];
std::chrono::seconds interval( 1 );
for(int i = 0; i < 10; i++) {
f1 << a;
f2.open("1kibfiletoread");
f2 >> b;
f2.close();
std::this_thread::sleep_for( interval );
}
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment