Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flame-clmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flame
flame-clmc
Commits
69e25c60
Commit
69e25c60
authored
7 years ago
by
MJB
Browse files
Options
Downloads
Patches
Plain Diff
Updated telegraf-agents test to include host metrics and fixed but in ffmpeg agent configuration
parent
f8de58c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/telegraf-agents/rspec.yml
+2
-2
2 additions, 2 deletions
test/telegraf-agents/rspec.yml
test/telegraf-agents/test_telegraf_agents.py
+6
-12
6 additions, 12 deletions
test/telegraf-agents/test_telegraf_agents.py
with
8 additions
and
14 deletions
test/telegraf-agents/rspec.yml
+
2
−
2
View file @
69e25c60
...
...
@@ -79,11 +79,11 @@ hosts:
ipendpoint_id
:
"
metadata_database_I1_apache1"
influxdb_url
:
"
http://192.168.50.10:8086"
database_name
:
"
CLMCMetrics"
-
name
:
ipendpoin
t
-
name
:
hos
t
cpus
:
1
memory
:
2048
disk
:
"
10GB"
service_name
:
"
ipendpoin
t"
service_name
:
"
hos
t"
forward_ports
:
-
guest
:
80
host
:
8085
...
...
This diff is collapsed.
Click to expand it.
test/telegraf-agents/test_telegraf_agents.py
+
6
−
12
View file @
69e25c60
...
...
@@ -9,7 +9,7 @@ from influxdb import InfluxDBClient
(
'
nginx
'
),
(
'
mongo
'
),
(
'
ffmpeg
'
),
(
'
ipendpoin
t
'
),
(
'
hos
t
'
),
])
def
test_service_name
(
telegraf_agent_config
,
service_name
):
assert
any
(
s
[
'
name
'
]
==
service_name
for
s
in
telegraf_agent_config
[
'
hosts
'
]),
"
{0} not in list of hosts
"
.
format
(
service_name
)
...
...
@@ -23,7 +23,11 @@ def test_ping(telegraf_agent_config):
@pytest.mark.parametrize
(
"
measurement, query, expected_result
"
,
[
(
'
nginx
'
,
'
SELECT mean(
"
requests
"
) AS
"
mean
"
FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
nginx
"'
,
0
),
(
'
cpu
'
,
'
SELECT mean(
"
usage_idle
"
) AS
"
mean
"
FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
cpu
"'
,
0
),
(
'
mongodb
'
,
'
SELECT mean(
"
net_in_bytes
"
) AS
"
mean
"
FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
mongodb
"'
,
0
)
(
'
mongodb
'
,
'
SELECT mean(
"
net_in_bytes
"
) AS
"
mean
"
FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
mongodb
"'
,
0
),
(
'
net
'
,
'
SELECT mean(
"
bytes_sent
"
) AS
"
mean
"
FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
net
"'
,
0
),
(
'
disk
'
,
'
SELECT mean(
"
free
"
) AS
"
mean
"
FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
disk
"'
,
0
),
(
'
diskio
'
,
'
SELECT mean(
"
write_bytes
"
) AS
"
mean
"
FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
diskio
"'
,
0
),
(
'
mem
'
,
'
SELECT mean(
"
free
"
) AS
"
mean
"
FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
mem
"'
,
0
)
])
def
test_all_inputs
(
influxdb
,
measurement
,
query
,
expected_result
):
"""
Tests measurements are received from an input plugin aggregated across all services
...
...
@@ -37,16 +41,6 @@ def test_all_inputs(influxdb, measurement, query, expected_result):
actual_result
=
points
[
0
][
'
mean
'
]
assert
actual_result
>
expected_result
,
"
actual result {0} is not > expected result {1} for query {2}
"
.
format
(
actual_result
,
str
(
expected_result
),
query
)
@pytest.mark.parametrize
(
"
ipendpoint, measurements
"
,
[
(
'
id1
'
,
[{
'
measurement
'
:
'
cpu
'
,
'
query
'
:
'
query
'
,
'
result
'
:
'
result
'
}
,
{
'
measurement
'
:
'
nginx
'
,
'
query
'
:
'
query
'
,
'
result
'
:
'
result
'
},
{
'
measurement
'
:
'
mongo
'
,
'
query
'
:
'
query
'
,
'
result
'
:
'
result
'
}]),
(
'
id2
'
,
[{
'
measurement
'
:
'
cpu
'
,
'
query
'
:
'
query
'
,
'
result
'
:
'
result
'
}
,
{
'
measurement
'
:
'
nginx
'
,
'
query
'
:
'
query
'
,
'
result
'
:
'
result
'
}])
])
def
test_multiple_inputs_on_a_service
(
influxdb
,
ipendpoint
,
measurements
):
"""
This test checks that a service configured with multiple input plugins as separate telegraf config files generates measurements in the database
"""
# for each item in the measurement list run the query and test the result
assert
1
@pytest.mark.parametrize
(
"
query, expected_result
"
,
[(
'
filter query
'
,
0
),
(
'
filter query
'
,
0
),
...
...
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