Commit 62e58e94 authored by Carla Guillen's avatar Carla Guillen

Fixing issue with connection details and template for the persystsql operator....

Fixing issue with connection details and template for the persystsql operator. Updating examples of config files.
parent e8979586
template_persystsql def1 {
interval 1000
minValues 3
duplicate false
streaming true
relaxed true
;every 2,5 minutes
interval 150000
minValues 1
duplicate false
streaming true
relaxed true
delay 2000
backend mariadb
mariadb_host some.server.lrz.de
mariadb_user me_the_user
mariadb_password secret
mariadb_database_name hpctest
mariadb_port 3306
mariadb_rotation EVERY_MONTH
number_quantiles 10
}
persystsql cpi_p {
default def1
number_quantiles 10
topic_quantiles
severity_threshold 1.5
severity_exponent 2
severity_formula formula1
severity_max_memory 100000000
persystsql cpi {
default def1
property_id 50
severity_threshold 0.25
severity_exponent 0.1
severity_formula FORMULA1
input {
;/.../computenode/cpux/cpi
sensor "<bottomup 1>cpi"
sensor "<bottomup>CPI"
}
output {
globalOutput {
; In this case "bottomup 1" is the sensor tree level associated to compute nodes
; /slurmjobid/cpi/avg
sensor "<bottomup 1>cpi.avg" {
mqttsuffix /cpi.avg
; /slurmjobid/cpi.avg
sensor "<bottomup 1>CPI.avg" {
mqttsuffix /CPI.avg
operation average
}
sensor "<bottomup 1>cpi.numobs" {
mqttsuffix /cpi.numobs
sensor "<bottomup 1>CPI.numobs" {
mqttsuffix /CPI.numobs
operation numobs
}
; sensor "<bottomup 1>cpi.avgseverity" {
; mqttsuffix /cpi.avgseverity
; operation average_severity
; }
sensor "<bottomup 1>CPI.avgseverity" {
mqttsuffix /CPI.avgseverity
operation average_severity
}
; sensor "<bottomup 1>cpi.quantile" {
; mqttsuffix /cpi.quantile
; operation deciles
; }
sensor "<bottomup 1>CPI.quantile" {
mqttsuffix /CPI.quantile
operation deciles
}
}
}
persystsql frequency_p {
default def1
number_quantiles 10
input {
persystsql frequency {
default def1
property_id 51
severity_threshold 2700
severity_exponent 0.1
severity_formula FORMULA1
sensor "<bottomup 1>frequency"
input {
sensor "<bottomup>FREQUENCY"
}
output {
; In this case "bottomup 1" is the sensor tree level associated to compute nodes
sensor "<bottomup 1>frequency.avg" {
mqttsuffix /frequency.avg
globalOutput {
sensor "<bottomup 1>FREQUENCY.avg" {
mqttsuffix /FREQUENCY.avg
operation average
}
sensor "<bottomup 1>frequency.numobs" {
mqttsuffix /frequency.numobs
sensor "<bottomup 1>FREQUENCY.numobs" {
mqttsuffix /FREQUENCY.numobs
operation numobs
}
sensor "<bottomup 1>FREQUENCY.avgseverity" {
mqttsuffix /FREQUENCY.avgseverity
operation average_severity
}
sensor "<bottomup 1>FREQUENCY.quantile" {
mqttsuffix /FREQUENCY.quantile
operation deciles
}
}
}
persystsql membandwt {
default def1
property_id 73
severity_threshold 20000
severity_exponent 1
severity_formula FORMULA2
input {
sensor "<bottomup 1>MEMORY_BANDWIDTH"
}
globalOutput {
sensor "<bottomup 1>MEMORY_BANDWIDTH.avg" {
mqttsuffix /MEMORY_BANDWIDTH.avg
operation average
}
sensor "<bottomup 1>MEMORY_BANDWIDTH.numbobs" {
mqttsuffix /MEMORY_BANDWIDTH.numobs
operation numobs
}
sensor "<bottomup 1>MEMORY_BANDWIDTH.avgseverity" {
mqttsuffix /MEMORY_BANDWIDTH.avgseverity
operation average_severity
}
sensor "<bottomup 1>MEMORY_BANDWIDTH.quantile" {
mqttsuffix /MEMORY_BANDWIDTH.quantile
operation deciles
}
}
}
persystsql instr_per_second {
default def1
property_id 52
severity_threshold 2000000000
severity_exponent 1
severity_formula FORMULA2
input {
sensor "<bottomup>INSTRUCTIONS_PER_SECOND"
}
globalOutput {
sensor "<bottomup 1>INSTRUCTIONS_PER_SECOND.avg" {
mqttsuffix /INSTRUCTIONS_PER_SECOND.avg
operation average
}
sensor "<bottomup 1>INSTRUCTIONS_PER_SECOND.numobs" {
mqttsuffix /INSTRUCTIONS_PER_SECOND.numobs
operation numobs
}
sensor "<bottomup 1>INSTRUCTIONS_PER_SECOND.avgseverity" {
mqttsuffix /INSTRUCTIONS_PER_SECOND.avgseverity
operation average_severity
}
sensor "<bottomup 1>INSTRUCTIONS_PER_SECOND.quantile" {
mqttsuffix /INSTRUCTIONS_PER_SECOND.quantile
operation deciles
}
}
}
global {
mqttPrefix /test
}
template_supermucngperf def1 {
interval 10000
minValues 3
duplicate false
streaming true
; every 2.5 min
interval 150000
minValues 1
duplicate false
streaming true
}
supermucngperf cpi {
supermucngperf msr_derived {
default def1
measurement_interval 10000
go_back_ms 10000
measuring_interval 10000
input {
sensor "<bottomup>clocks"{
position 0
}
sensor "<bottomup>ref_clocks"{
position 1
}
sensor "<bottomup>instructions" {
position 2
}
sensor "<bottomup, filter cpu([0-9]|[1-3][0-9]|4[0-7])>CLOCKS"
sensor "<bottomup, filter cpu([0-9]|[1-3][0-9]|4[0-7])>CLOCKS_REF"
sensor "<bottomup, filter cpu([0-9]|[1-3][0-9]|4[0-7])>INSTRUCTIONS"
}
output {
sensor "<bottomup, filter /login08/cpu>cpi" {
mqttsuffix /cpi
position 3
scaling_factor 100
sensor "<bottomup, filter /login08/cpu>CPI" {
mqttsuffix /CPI
metadata {
scale 0.00001
}
}
sensor "<bottomup, filter /login08/cpu>frequency" {
mqttsuffix /frequency
position 4
scaling_factor 1
sensor "<bottomup, filter /login08/cpu>FREQUENCY" {
mqttsuffix /FREQUENCY
metadata {
scale 0.0001
}
}
sensor "<bottomup, filter /login08/cpu>INSTRUCTIONS_PER_SECOND" {
mqttsuffix /INSTRUCTIONS_PER_SECOND
metadata {
scale 0.01
}
}
}
}
......@@ -69,14 +69,6 @@ void PerSystSqlConfigurator::sensorBase(AggregatorSensorBase& s, CFG_VAL config)
}
void PerSystSqlConfigurator::operatorAttributes(PerSystSqlOperator& op, CFG_VAL config) {
std::string host;
std::string user;
std::string password;
std::string database_name;
int port = -1;
MariaDB::Rotation_t rotation = MariaDB::EVERY_MONTH;
PerSystSqlOperator::Backend_t backend = PerSystSqlOperator::DEFAULT;
unsigned int every_x_days = 0;
BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config) {
if (boost::iequals(val.first, "number_quantiles")) {
unsigned int num_quantiles = std::stoul(val.second.data());
......@@ -106,39 +98,36 @@ void PerSystSqlConfigurator::operatorAttributes(PerSystSqlOperator& op, CFG_VAL
op.setSeverityMaxMemory(max_memory);
} else if (boost::iequals(val.first, "backend")) {
if(val.second.data() == "cassandra") {
backend = PerSystSqlOperator::CASSANDRA;
op.setBackend(PerSystSqlOperator::CASSANDRA);
} else if(val.second.data() == "mariadb") {
backend = PerSystSqlOperator::MARIADB;
op.setBackend(PerSystSqlOperator::MARIADB);
}
} else if(boost::iequals(val.first, "property_id")){
} else if(boost::iequals(val.first, "property_id")){
auto property_id = std::stoi(val.second.data());
op.setPropertyId(property_id);
} else if (boost::iequals(val.first, "mariadb_host")) {
host = val.second.data();
op.setMariaDBHost(val.second.data());
} else if (boost::iequals(val.first, "mariadb_user")){
user = val.second.data();
op.setMariaDBUser(val.second.data());
} else if (boost::iequals(val.first, "mariadb_password")){
password = val.second.data();
op.setMariaDBPassword(val.second.data());
} else if (boost::iequals(val.first, "mariadb_database_name")){
database_name = val.second.data();
op.setMariaDBDatabaseName(val.second.data());
} else if (boost::iequals(val.first, "mariadb_port")){
port = std::stoi(val.second.data());
int port = std::stoi(val.second.data());
op.setMariaDBPort(port);
} else if (boost::iequals(val.first, "mariadb_rotation")){
auto found = _rotation_map.find(val.second.data());
if (found != _rotation_map.end()){
rotation = found->second;
op.setMariaDBRotation(found->second);
} else {
LOG(error) << " Rotation strategy (" << val.second.data() << ") not found.";
}
} else if (boost::iequals(val.first, "mariadb_every_x_days")){
every_x_days = std::stoi(val.second.data());
unsigned int every_x_days = std::stoi(val.second.data());
op.setMariaDBEveryXDays(every_x_days);
}
}
if(backend == PerSystSqlOperator::MARIADB) {
op.setMariaDBConnection(host, user, password, database_name, port, rotation, every_x_days);
}
}
bool PerSystSqlConfigurator::unit(UnitTemplate<AggregatorSensorBase>& u) {
......
......@@ -106,7 +106,9 @@ void PerSystSqlOperator::printConfig(LOG_LEVEL ll) {
LOG_VAR(ll) << "\tDatabase=" << _conn.database_name;
LOG_VAR(ll) << "\tPort=" << _conn.port;
LOG_VAR(ll) << "\tRotation=" << _conn.rotation;
LOG_VAR(ll) << "\tEvery_X_days=" << _conn.every_x_days;
if(_conn.rotation == MariaDB::EVERY_XDAYS){
LOG_VAR(ll) << "\tEvery_X_days=" << _conn.every_x_days;
}
}
LOG_VAR(ll) << "Property Configuration:";
LOG_VAR(ll) << "\tnumber_of_even_quantiles=" << _number_of_even_quantiles;
......
......@@ -101,14 +101,32 @@ public:
_backend = backend;
}
void setMariaDBConnection(const std::string & host, const std::string & user, const std::string & password, const std::string & database_name, int port, MariaDB::Rotation_t rotation, unsigned int every_x_days=0){
void setMariaDBEveryXDays(unsigned int every_x_days){
_conn.every_x_days = every_x_days;
}
void setMariaDBHost(const std::string & host){
_conn.host = host;
}
void setMariaDBUser(const std::string & user){
_conn.user = user;
}
void setMariaDBPassword(const std::string & password){
_conn.password = password;
}
void setMariaDBDatabaseName(const std::string & database_name){
_conn.database_name = database_name;
}
void setMariaDBPort(int port){
_conn.port = port;
}
void setMariaDBRotation(MariaDB::Rotation_t rotation){
_conn.rotation = rotation;
_conn.every_x_days = every_x_days;
}
void setPropertyId(int property_id){
......
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