Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos
Commits
9a68ca09
Commit
9a68ca09
authored
Oct 11, 2019
by
Rafael Monnerat
👻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor: Dump into csv is not required anymore.
This feature became useless as fluentd isn't a priority anymore
parent
78bce37f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
126 deletions
+4
-126
software/monitor/buildout.hash.cfg
software/monitor/buildout.hash.cfg
+2
-5
software/monitor/instance-monitor.cfg.jinja2
software/monitor/instance-monitor.cfg.jinja2
+0
-7
software/monitor/instance.cfg
software/monitor/instance.cfg
+0
-2
software/monitor/script/collect_csv_dump.py
software/monitor/script/collect_csv_dump.py
+0
-101
software/monitor/software.cfg
software/monitor/software.cfg
+2
-11
No files found.
software/monitor/buildout.hash.cfg
View file @
9a68ca09
...
...
@@ -15,11 +15,11 @@
[template]
filename = instance.cfg
md5sum =
677f827c03309bdcecbc3c6405bd760c
md5sum =
a5af462b547ce228d5a3fc0db76c2622
[template-monitor]
filename = instance-monitor.cfg.jinja2
md5sum =
920a3451b946365536650dd67a50f847
md5sum =
26da87508315194930984180cc6cc3f8
[template-monitor-edgetest]
filename = instance-monitor-edgetest.cfg.jinja2
...
...
@@ -37,6 +37,3 @@ md5sum = 2eb5596544d9c341acf653d4f7ce2680
filename = network_bench.cfg.in
md5sum = cfcbf2002b8eff5153e2bf68ed24b720
[monitor-collect-csv-dump]
filename = script/collect_csv_dump.py
md5sum = cad2402bbd21907cfed6bc5af8c5d3ab
software/monitor/instance-monitor.cfg.jinja2
View file @
9a68ca09
...
...
@@ -6,7 +6,6 @@ parts =
symlink-re6st-logs
symlink-collected-logs
python-symlink
monitor-collect-csv-wrapper
monitor-base
monitor-check-memory-usage
monitor-check-cpu-usage
...
...
@@ -53,12 +52,6 @@ recipe = plone.recipe.command
command = ln -sf {{ buildout_bin }}/pythonwitheggs ${monitor-directory:bin}/python
update-command = ${:command}
[monitor-collect-csv-wrapper]
recipe = slapos.cookbook:wrapper
command-line =
${monitor-directory:bin}/python {{ monitor_collect_csv_dump }} --output_folder ${monitor-directory:consumption}
wrapper-path = ${monitor-directory:bin}/monitor-collect-csv-dump
[monitor-check-memory-usage]
recipe = slapos.cookbook:wrapper
command-line = {{ buildout_bin}}/check-computer-memory
...
...
software/monitor/instance.cfg
View file @
9a68ca09
...
...
@@ -21,7 +21,6 @@ context = key develop_eggs_directory buildout:develop-eggs-directory
key slapparameter_dict slap-configuration:configuration
raw buildout_bin ${buildout:bin-directory}
raw monitor_template_output ${monitor-template:output}
raw monitor_collect_csv_dump ${monitor-collect-csv-dump:output}
mode = 0644
[instance-base-edgetest]
...
...
@@ -51,7 +50,6 @@ context = import json_module json
key slapparameter_dict slap-configuration:configuration
raw buildout_bin ${buildout:bin-directory}
raw monitor_template_output ${monitor-template:output}
raw monitor_collect_csv_dump ${monitor-collect-csv-dump:output}
mode = 0644
...
...
software/monitor/script/collect_csv_dump.py
deleted
100644 → 0
View file @
78bce37f
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010-2016 Vifib SARL and Contributors.
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
argparse
import
csv
from
slapos.util
import
mkdir_p
from
slapos.collect.db
import
Database
def
skip_bootstrap
(
self
):
return
Database
.
_bootstrap
=
skip_bootstrap
def
parseArguments
():
"""
Parse arguments for monitor collector instance.
"""
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'--output_folder'
,
help
=
'Path of the folder where output files should be written.'
)
parser
.
add_argument
(
'--collector_db'
,
default
=
'/srv/slapgrid/var/data-log/'
,
help
=
'The path of slapos collect database is located.'
)
return
parser
.
parse_args
()
def
writeFile
(
name
,
folder
,
date_scope
,
rows
):
if
os
.
path
.
exists
(
os
.
path
.
join
(
folder
,
"%s/dump_%s.csv"
%
(
date_scope
,
name
))):
# File already exists, no reason to recreate it.
return
mkdir_p
(
os
.
path
.
join
(
folder
,
date_scope
),
0o755
)
file_io
=
open
(
os
.
path
.
join
(
folder
,
"%s/dump_%s.csv"
%
(
date_scope
,
name
)),
"w"
)
csv_output
=
csv
.
writer
(
file_io
)
csv_output
.
writerows
(
rows
)
file_io
.
close
()
def
dump_table_into_csv
(
db
,
folder
):
db
.
connect
()
table_list
=
db
.
getTableList
()
# Save all dates first, as db.selector may switch the cursor
date_list
=
[(
date_scope
,
_
)
\
for
date_scope
,
_
in
db
.
getDateScopeList
(
reported
=
1
)]
for
date_scope
,
amount
in
date_list
:
for
table
in
table_list
:
if
os
.
path
.
exists
(
os
.
path
.
join
(
folder
,
"%s/dump_%s.csv"
%
(
date_scope
,
table
))):
# File already exists, no reason to recreate it.
continue
writeFile
(
table
,
folder
,
date_scope
,
db
.
select
(
table
,
date_scope
))
db
.
close
()
if
__name__
==
"__main__"
:
parser
=
parseArguments
()
if
parser
.
output_folder
is
None
:
raise
Exception
(
"Invalid ouput folder: %s"
%
parser
.
output_folder
)
if
parser
.
collector_db
is
None
:
raise
Exception
(
"Invalid collector database folder: %s"
%
parser
.
collector_db
)
if
not
os
.
path
.
exists
(
parser
.
output_folder
)
and
\
os
.
path
.
isdir
(
parser
.
output_folder
):
raise
Exception
(
"Invalid ouput folder: %s"
%
parser
.
output_folder
)
if
not
os
.
path
.
exists
(
parser
.
collector_db
):
print
"Collector database not found..."
dump_table_into_csv
(
Database
(
parser
.
collector_db
),
parser
.
output_folder
)
software/monitor/software.cfg
View file @
9a68ca09
...
...
@@ -6,9 +6,9 @@ extends =
../../component/python-cryptography/buildout.cfg
../../component/wget/buildout.cfg
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
../../stack/slapos
-dev
.cfg
parts =
parts
+
=
wget
slapos-cookbook
network-bench-cfg
...
...
@@ -16,7 +16,6 @@ parts =
template
template-monitor-edgetest
template-monitor
monitor-collect-csv-dump
[template]
recipe = slapos.recipe.template
...
...
@@ -50,12 +49,6 @@ url = ${:_profile_base_location_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
[monitor-collect-csv-dump]
<= monitor-template-script
url = ${:_profile_base_location_}/script/${:filename}
filename = collect_csv_dump.py
output = ${:destination}/${:filename}
[extra-eggs]
<= monitor-eggs
interpreter = pythonwitheggs
...
...
@@ -70,8 +63,6 @@ scripts =
networkbench
onetimedownload
monitor.bootstrap
monitor.collect
monitor.runpromise
monitor.genstatus
monitor.configwrite
check-computer-memory
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment