srsLTE/srsue/hdr/metrics_stdout.h

63 lines
1.9 KiB
C
Raw Normal View History

2019-04-26 12:27:38 -07:00
/*
2020-03-13 04:12:52 -07:00
* Copyright 2013-2020 Software Radio Systems Limited
2017-05-30 06:38:04 -07:00
*
2019-04-26 12:27:38 -07:00
* This file is part of srsLTE.
2017-05-30 06:38:04 -07:00
*
2019-04-26 12:27:38 -07:00
* srsLTE is free software: you can redistribute it and/or modify
2017-05-30 06:38:04 -07:00
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
2019-04-26 12:27:38 -07:00
* srsLTE is distributed in the hope that it will be useful,
2017-05-30 06:38:04 -07:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
/******************************************************************************
* File: metrics_stdout.h
* Description: Metrics class printing to stdout.
*****************************************************************************/
2018-03-31 10:04:04 -07:00
#ifndef SRSUE_METRICS_STDOUT_H
#define SRSUE_METRICS_STDOUT_H
2017-05-30 06:38:04 -07:00
#include <pthread.h>
#include <stdint.h>
#include <string>
2017-09-22 03:31:46 -07:00
#include "srslte/common/metrics_hub.h"
2017-05-30 06:38:04 -07:00
#include "ue_metrics_interface.h"
namespace srsue {
2017-09-22 03:31:46 -07:00
class metrics_stdout : public srslte::metrics_listener<ue_metrics_t>
2017-05-30 06:38:04 -07:00
{
public:
metrics_stdout: print new table header if neighbour cells change this fixes an issue where the stdout metrics isn't readable if the only neighbour cell gets removed during the 10s where no table header is printed. --------Signal--------------Neighbor----DL-------------------------------------UL---------------------- cc pci rsrp pl cfo pci rsrp mcs snr turbo brate bler ta_us mcs buff brate bler 0 2 -66 61 -3.3k 1 -76 11 18 1.1 8.4M 3% 0.0 21 262 167k 0% 0 2 -65 60 -3.3k 1 -76 12 19 1.1 9.6M 2% 0.0 22 476 214k 0% 0 2 -65 60 -3.3k 1 -76 16 22 1.3 13M 3% 0.0 23 1.1k 734k 0% 0 2 -64 59 -3.3k 1 -76 17 23 1.3 15M 2% 0.0 23 602 424k 0% 0 2 -63 58 -3.3k 1 -77 20 25 1.4 19M 3% 0.0 23 501 304k 0% 0 2 -62 57 -3.3k 1 -77 22 27 1.8 20M 10% 0.0 22 417 418k 0% 0 2 -61 56 -3.3k 1 -77 24 28 1.8 25M 9% 0.0 23 396 439k 0% 0 2 -61 56 -3.3k 1 -77 26 29 1.5 23M 22% 0.0 23 841 407k 0% 0 2 -60 55 -3.3k 1 -77 27 31 1.3 27M 11% 0.0 23 890 1.1M 0% 0 2 -59 54 -3.3k 1 -77 27 32 1.00 30M 3% 0.0 23 583 524k 0% 0 2 -59 54 -3.3k 1 -77 27 32 0.92 32M 1% 0.0 23 1.1k 503k 0% --------Signal--------------DL-------------------------------------UL---------------------- cc pci rsrp pl cfo mcs snr turbo brate bler ta_us mcs buff brate bler 0 2 -59 54 -3.3k 27 31 1.1 30M 4% 0.0 23 1.2k 529k 0% 0 2 -60 55 -3.3k 27 30 1.4 25M 18% 0.0 23 540 442k 0% 0 2 -61 56 -3.3k 26 29 1.6 23M 21% 0.0 23 536 429k 0% 0 2 -62 57 -3.3k 24 28 1.8 23M 13% 0.0 23 834 456k 0% 0 2 -62 57 -3.3k 1 -78 21 26 1.6 20M 7% 0.0 23 723 425k 0% 0 2 -63 58 -3.3k 1 -76 17 22 1.1 15M 3% 0.0 23 470 267k 0% 0 2 -64 59 -3.3k 1 -77 17 22 1.3 15M 3% 0.0 23 167 280k 0% 0 2 -65 60 -3.3k 1 -76 14 21 1.3 11M 2% 0.0 22 57 223k 0% 0 2 -65 60 -3.3k 1 -76 12 19 1.2 9.0M 3% 0.0 21 135 182k 0% 0 2 -66 61 -3.4k 1 -70 9.3 17 1.0 6.9M 2% 0.0 21 246 126k 0% 0 2 -67 62 -3.3k 1 -75 8.2 16 1.1 4.9M 3% 0.0 20 0.0 122k 0%
2020-09-30 07:29:31 -07:00
metrics_stdout(){};
2017-05-30 06:38:04 -07:00
void toggle_print(bool b);
2020-01-13 04:14:46 -08:00
void set_metrics(const ue_metrics_t& m, const uint32_t period_usec);
void set_ue_handle(ue_metrics_interface* ue_);
void stop(){};
2017-05-30 06:38:04 -07:00
private:
std::string float_to_string(float f, int digits);
std::string float_to_eng_string(float f, int digits);
metrics_stdout: print new table header if neighbour cells change this fixes an issue where the stdout metrics isn't readable if the only neighbour cell gets removed during the 10s where no table header is printed. --------Signal--------------Neighbor----DL-------------------------------------UL---------------------- cc pci rsrp pl cfo pci rsrp mcs snr turbo brate bler ta_us mcs buff brate bler 0 2 -66 61 -3.3k 1 -76 11 18 1.1 8.4M 3% 0.0 21 262 167k 0% 0 2 -65 60 -3.3k 1 -76 12 19 1.1 9.6M 2% 0.0 22 476 214k 0% 0 2 -65 60 -3.3k 1 -76 16 22 1.3 13M 3% 0.0 23 1.1k 734k 0% 0 2 -64 59 -3.3k 1 -76 17 23 1.3 15M 2% 0.0 23 602 424k 0% 0 2 -63 58 -3.3k 1 -77 20 25 1.4 19M 3% 0.0 23 501 304k 0% 0 2 -62 57 -3.3k 1 -77 22 27 1.8 20M 10% 0.0 22 417 418k 0% 0 2 -61 56 -3.3k 1 -77 24 28 1.8 25M 9% 0.0 23 396 439k 0% 0 2 -61 56 -3.3k 1 -77 26 29 1.5 23M 22% 0.0 23 841 407k 0% 0 2 -60 55 -3.3k 1 -77 27 31 1.3 27M 11% 0.0 23 890 1.1M 0% 0 2 -59 54 -3.3k 1 -77 27 32 1.00 30M 3% 0.0 23 583 524k 0% 0 2 -59 54 -3.3k 1 -77 27 32 0.92 32M 1% 0.0 23 1.1k 503k 0% --------Signal--------------DL-------------------------------------UL---------------------- cc pci rsrp pl cfo mcs snr turbo brate bler ta_us mcs buff brate bler 0 2 -59 54 -3.3k 27 31 1.1 30M 4% 0.0 23 1.2k 529k 0% 0 2 -60 55 -3.3k 27 30 1.4 25M 18% 0.0 23 540 442k 0% 0 2 -61 56 -3.3k 26 29 1.6 23M 21% 0.0 23 536 429k 0% 0 2 -62 57 -3.3k 24 28 1.8 23M 13% 0.0 23 834 456k 0% 0 2 -62 57 -3.3k 1 -78 21 26 1.6 20M 7% 0.0 23 723 425k 0% 0 2 -63 58 -3.3k 1 -76 17 22 1.1 15M 3% 0.0 23 470 267k 0% 0 2 -64 59 -3.3k 1 -77 17 22 1.3 15M 3% 0.0 23 167 280k 0% 0 2 -65 60 -3.3k 1 -76 14 21 1.3 11M 2% 0.0 22 57 223k 0% 0 2 -65 60 -3.3k 1 -76 12 19 1.2 9.0M 3% 0.0 21 135 182k 0% 0 2 -66 61 -3.4k 1 -70 9.3 17 1.0 6.9M 2% 0.0 21 246 126k 0% 0 2 -67 62 -3.3k 1 -75 8.2 16 1.1 4.9M 3% 0.0 20 0.0 122k 0%
2020-09-30 07:29:31 -07:00
void print_table(const bool display_neighbours);
2017-05-30 06:38:04 -07:00
metrics_stdout: print new table header if neighbour cells change this fixes an issue where the stdout metrics isn't readable if the only neighbour cell gets removed during the 10s where no table header is printed. --------Signal--------------Neighbor----DL-------------------------------------UL---------------------- cc pci rsrp pl cfo pci rsrp mcs snr turbo brate bler ta_us mcs buff brate bler 0 2 -66 61 -3.3k 1 -76 11 18 1.1 8.4M 3% 0.0 21 262 167k 0% 0 2 -65 60 -3.3k 1 -76 12 19 1.1 9.6M 2% 0.0 22 476 214k 0% 0 2 -65 60 -3.3k 1 -76 16 22 1.3 13M 3% 0.0 23 1.1k 734k 0% 0 2 -64 59 -3.3k 1 -76 17 23 1.3 15M 2% 0.0 23 602 424k 0% 0 2 -63 58 -3.3k 1 -77 20 25 1.4 19M 3% 0.0 23 501 304k 0% 0 2 -62 57 -3.3k 1 -77 22 27 1.8 20M 10% 0.0 22 417 418k 0% 0 2 -61 56 -3.3k 1 -77 24 28 1.8 25M 9% 0.0 23 396 439k 0% 0 2 -61 56 -3.3k 1 -77 26 29 1.5 23M 22% 0.0 23 841 407k 0% 0 2 -60 55 -3.3k 1 -77 27 31 1.3 27M 11% 0.0 23 890 1.1M 0% 0 2 -59 54 -3.3k 1 -77 27 32 1.00 30M 3% 0.0 23 583 524k 0% 0 2 -59 54 -3.3k 1 -77 27 32 0.92 32M 1% 0.0 23 1.1k 503k 0% --------Signal--------------DL-------------------------------------UL---------------------- cc pci rsrp pl cfo mcs snr turbo brate bler ta_us mcs buff brate bler 0 2 -59 54 -3.3k 27 31 1.1 30M 4% 0.0 23 1.2k 529k 0% 0 2 -60 55 -3.3k 27 30 1.4 25M 18% 0.0 23 540 442k 0% 0 2 -61 56 -3.3k 26 29 1.6 23M 21% 0.0 23 536 429k 0% 0 2 -62 57 -3.3k 24 28 1.8 23M 13% 0.0 23 834 456k 0% 0 2 -62 57 -3.3k 1 -78 21 26 1.6 20M 7% 0.0 23 723 425k 0% 0 2 -63 58 -3.3k 1 -76 17 22 1.1 15M 3% 0.0 23 470 267k 0% 0 2 -64 59 -3.3k 1 -77 17 22 1.3 15M 3% 0.0 23 167 280k 0% 0 2 -65 60 -3.3k 1 -76 14 21 1.3 11M 2% 0.0 22 57 223k 0% 0 2 -65 60 -3.3k 1 -76 12 19 1.2 9.0M 3% 0.0 21 135 182k 0% 0 2 -66 61 -3.4k 1 -70 9.3 17 1.0 6.9M 2% 0.0 21 246 126k 0% 0 2 -67 62 -3.3k 1 -75 8.2 16 1.1 4.9M 3% 0.0 20 0.0 122k 0%
2020-09-30 07:29:31 -07:00
bool do_print = false;
bool table_has_neighbours = false; ///< state of last table head
uint8_t n_reports = 10;
ue_metrics_interface* ue = nullptr;
2017-05-30 06:38:04 -07:00
};
} // namespace srsue
2018-03-31 10:04:04 -07:00
#endif // SRSUE_METRICS_STDOUT_H