Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kpi Generator - deprecated
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
scripts
Kpi Generator - deprecated
Commits
33886acd
Commit
33886acd
authored
4 years ago
by
Benedikt Heinrichs
Browse files
Options
Downloads
Patches
Plain Diff
Create Testing Branch
parent
7905a050
No related branches found
No related tags found
No related merge requests found
Pipeline
#445197
passed
4 years ago
Stage: test
Stage: release
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/KpiGenerator/Program.cs
+1
-23
1 addition, 23 deletions
src/KpiGenerator/Program.cs
src/KpiGenerator/Reporter/HamsterReporter.cs
+1
-1
1 addition, 1 deletion
src/KpiGenerator/Reporter/HamsterReporter.cs
with
2 additions
and
24 deletions
src/KpiGenerator/Program.cs
+
1
−
23
View file @
33886acd
...
...
@@ -17,8 +17,6 @@ namespace Coscine.KpiGenerator
ConsulConfiguration
configuration
=
new
ConsulConfiguration
();
DataConnection
.
DefaultSettings
=
new
CoscineSettings
(
configuration
);
var
liveMode
=
configuration
.
GetStringAndWait
(
"coscine/global/reporting/live"
);
// Run all Generators for the KPI
// each Generator returns a list of KPI, it can have zero entries.
List
<
Kpi
>
newKpis
=
new
List
<
Kpi
>();
...
...
@@ -27,29 +25,9 @@ namespace Coscine.KpiGenerator
newKpis
.
AddRange
(
new
GenerateRDSQuotasPerIkz
(
configuration
,
"2973"
).
GenerateKpis
());
newKpis
.
AddRange
(
new
GenerateUsersPerIkz
(
configuration
,
"2967"
).
GenerateKpis
());
// when all generators are done
var
kpiModel
=
new
KpiModel
();
// each value is stored within the database
foreach
(
Kpi
kpi
in
newKpis
)
{
kpiModel
.
Insert
(
kpi
);
}
// get all values from the database that have not been successfully sent yet
var
kpiToProcess
=
kpiModel
.
GetAllWhere
((
kpi
)
=>
(
kpi
.
SentSuccessfully
==
false
)).
ToList
();
// try to sent them
HamsterReporter
hamsterReporter
=
new
HamsterReporter
(
configuration
);
if
(
liveMode
==
"1"
)
{
hamsterReporter
.
Send
(
kpiToProcess
);
}
// if the kpi were sent successful mark all values within the database as successfully sent
foreach
(
Kpi
kpi
in
kpiToProcess
)
{
kpiModel
.
MarkAsSent
(
kpi
);
}
hamsterReporter
.
Send
(
newKpis
);
}
}
}
This diff is collapsed.
Click to expand it.
src/KpiGenerator/Reporter/HamsterReporter.cs
+
1
−
1
View file @
33886acd
...
...
@@ -17,7 +17,7 @@ namespace Coscine.KpiGenerator.Reporter
public
HamsterReporter
(
IConfiguration
configuration
)
{
_password
=
configuration
.
GetStringAndWait
(
"coscine/global/reporting/password"
);
_liveMode
=
configuration
.
GetStringAndWait
(
"coscine/global/reporting/live"
)
;
_liveMode
=
"0"
;
_restClient
=
new
RestClient
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment