Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
FMS_Project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bashar.hussein
FMS_Project
Commits
6105cc7b
Commit
6105cc7b
authored
Jul 18, 2023
by
ReemyHasan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rethink scheduler
parent
e47acd41
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
0 deletions
+58
-0
.gitignore
SNMP_Pipeline/SchedulingRethink/.idea/.gitignore
+3
-0
SchedulingRethink.iml
SNMP_Pipeline/SchedulingRethink/.idea/SchedulingRethink.iml
+10
-0
profiles_settings.xml
...ingRethink/.idea/inspectionProfiles/profiles_settings.xml
+6
-0
misc.xml
SNMP_Pipeline/SchedulingRethink/.idea/misc.xml
+4
-0
modules.xml
SNMP_Pipeline/SchedulingRethink/.idea/modules.xml
+8
-0
main.py
SNMP_Pipeline/SchedulingRethink/main.py
+26
-0
output.txt
SNMP_Pipeline/SchedulingRethink/output.txt
+1
-0
No files found.
SNMP_Pipeline/SchedulingRethink/.idea/.gitignore
0 → 100644
View file @
6105cc7b
# Default ignored files
/shelf/
/workspace.xml
SNMP_Pipeline/SchedulingRethink/.idea/SchedulingRethink.iml
0 → 100644
View file @
6105cc7b
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"PYTHON_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
>
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
SNMP_Pipeline/SchedulingRethink/.idea/inspectionProfiles/profiles_settings.xml
0 → 100644
View file @
6105cc7b
<component
name=
"InspectionProjectProfileManager"
>
<settings>
<option
name=
"USE_PROJECT_PROFILE"
value=
"false"
/>
<version
value=
"1.0"
/>
</settings>
</component>
\ No newline at end of file
SNMP_Pipeline/SchedulingRethink/.idea/misc.xml
0 → 100644
View file @
6105cc7b
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.10 (SchedulingRethink)"
project-jdk-type=
"Python SDK"
/>
</project>
\ No newline at end of file
SNMP_Pipeline/SchedulingRethink/.idea/modules.xml
0 → 100644
View file @
6105cc7b
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/.idea/SchedulingRethink.iml"
filepath=
"$PROJECT_DIR$/.idea/SchedulingRethink.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
SNMP_Pipeline/SchedulingRethink/main.py
0 → 100644
View file @
6105cc7b
import
rethinkdb
as
r
import
datetime
import
pytz
import
os
dir_path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
rdb
=
r
.
RethinkDB
()
conn
=
rdb
.
connect
(
"172.29.3.220"
,
28015
)
.
repl
()
s
=
rdb
.
db
(
"Traps"
)
.
table
(
"Raw-Traps"
)
.
run
()
time_threshold
=
60
*
1000
tz
=
pytz
.
timezone
(
'Etc/GMT-3'
)
current_datetime
=
datetime
.
datetime
.
now
(
tz
)
timestamp
=
current_datetime
.
timestamp
()
*
1000
e
=
rdb
.
db
(
"Traps"
)
.
table
(
'Raw-Traps'
)
.
filter
((
timestamp
-
rdb
.
row
[
'date'
])
>
time_threshold
)
.
delete
()
.
run
()
#print(e)
with
open
(
os
.
path
.
join
(
dir_path
,
'output.txt'
),
'a'
)
as
f
:
f
.
write
(
str
(
current_datetime
))
f
.
write
(
": "
)
f
.
write
(
str
(
e
))
f
.
write
(
'
\n
'
)
conn
.
close
()
\ No newline at end of file
SNMP_Pipeline/SchedulingRethink/output.txt
0 → 100644
View file @
6105cc7b
2023-07-18 14:03:34.161638+03:00: {'deleted': 27, 'errors': 0, 'inserted': 0, 'replaced': 0, 'skipped': 0, 'unchanged': 0}
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