-fix ftbfs
[oweals/gnunet.git] / src / sensor / gnunet-service-sensor_analysis.c
index a53c22589b371bb46678ce8bbaf827503e1fc4a1..6412031cb06db043a49802872a5b84cf0e5452b2 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C)
+     Copyright (C)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -89,7 +89,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
 /**
  * Hashmap of loaded sensors
  */
-struct GNUNET_CONTAINER_MultiHashMap *sensors;
+static struct GNUNET_CONTAINER_MultiHashMap *sensors;
 
 /*
  * Model library name
@@ -119,13 +119,13 @@ static struct SensorModel *models_tail;
 /**
  * My peer id
  */
-struct GNUNET_PeerIdentity peerid;
+static struct GNUNET_PeerIdentity peerid;
 
 /**
  * How many subsequent values required to flip anomaly label.
  * E.g. After 3 subsequent anomaly reports, status change to anomalous.
  */
-unsigned long long confirmation_count;
+static unsigned long long confirmation_count;
 
 /**
  * Destroy a created model
@@ -189,7 +189,9 @@ SENSOR_analysis_stop ()
  * @return #GNUNET_YES
  */
 static int
-sensor_watcher (void *cls, struct GNUNET_PEERSTORE_Record *record, char *emsg)
+sensor_watcher (void *cls,
+                const struct GNUNET_PEERSTORE_Record *record,
+                const char *emsg)
 {
   struct SensorModel *model = cls;
   double *val;
@@ -213,7 +215,8 @@ sensor_watcher (void *cls, struct GNUNET_PEERSTORE_Record *record, char *emsg)
     {
       model->anomalous = GNUNET_YES;
       LOG (GNUNET_ERROR_TYPE_WARNING,
-           "Anomaly state started for sensor `%s'.\n", model->sensor->name);
+           "Anomaly state started for sensor `%s', value: %f.\n",
+           model->sensor->name, val);
       SENSOR_reporting_anomaly_update (model->sensor, model->anomalous);
     }
   }
@@ -225,8 +228,9 @@ sensor_watcher (void *cls, struct GNUNET_PEERSTORE_Record *record, char *emsg)
         model->negative_count >= confirmation_count)
     {
       model->anomalous = GNUNET_NO;
-      LOG (GNUNET_ERROR_TYPE_INFO, "Anomaly state stopped for sensor `%s'.\n",
-           model->sensor->name);
+      LOG (GNUNET_ERROR_TYPE_INFO,
+          "Anomaly state stopped for sensor `%s', value: %f.\n",
+           model->sensor->name, val);
       SENSOR_reporting_anomaly_update (model->sensor, model->anomalous);
     }
   }