Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • coscine/backend/scripts/kpi-generator-deprecated
1 result
Select Git revision
Loading items
Show changes
Commits on Source (2)
...@@ -22,6 +22,8 @@ namespace Coscine.KpiGenerator ...@@ -22,6 +22,8 @@ namespace Coscine.KpiGenerator
ConsulConfiguration configuration = new ConsulConfiguration(); ConsulConfiguration configuration = new ConsulConfiguration();
DataConnection.DefaultSettings = new CoscineSettings(configuration); DataConnection.DefaultSettings = new CoscineSettings(configuration);
var liveMode = configuration.GetStringAndWait("coscine/global/reporting/live");
// Run all Generators for the KPI // Run all Generators for the KPI
// each Generator returns a list of KPI, it can have zero entries. // each Generator returns a list of KPI, it can have zero entries.
List<Kpi> newKpis = new List<Kpi>(); List<Kpi> newKpis = new List<Kpi>();
...@@ -43,7 +45,10 @@ namespace Coscine.KpiGenerator ...@@ -43,7 +45,10 @@ namespace Coscine.KpiGenerator
// try to sent them as a bundle with the csv method // try to sent them as a bundle with the csv method
HamsterReporter hamsterReporter = new HamsterReporter(configuration); HamsterReporter hamsterReporter = new HamsterReporter(configuration);
if (liveMode == "1")
{
hamsterReporter.Send(kpiToProcess); hamsterReporter.Send(kpiToProcess);
}
// if the kpi were sent successful mark all values within the database as successfully sent // if the kpi were sent successful mark all values within the database as successfully sent
foreach (Kpi kpi in kpiToProcess) foreach (Kpi kpi in kpiToProcess)
......