Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Scheduling Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xx network
Scheduling Scripts
Commits
936fe3f6
Commit
936fe3f6
authored
Oct 26, 2021
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Take in raw points log path
parent
e3dbb0e8
No related branches found
No related tags found
1 merge request
!1
Save raw points data
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
points.py
+7
-1
7 additions, 1 deletion
points.py
with
7 additions
and
1 deletion
points.py
+
7
−
1
View file @
936fe3f6
...
@@ -26,6 +26,7 @@ THOUSAND = 1_000
...
@@ -26,6 +26,7 @@ THOUSAND = 1_000
state_key
=
"
consensus_points_timestamp
"
# Static key used for states table
state_key
=
"
consensus_points_timestamp
"
# Static key used for states table
positive_points_func
=
'
submit_cmix_points
'
positive_points_func
=
'
submit_cmix_points
'
negative_points_func
=
'
submit_cmix_deductions
'
negative_points_func
=
'
submit_cmix_deductions
'
raw_points_log
=
''
#################
#################
...
@@ -143,7 +144,7 @@ def process_period(conn, substrate, keypair, point_info, start_period, end_perio
...
@@ -143,7 +144,7 @@ def process_period(conn, substrate, keypair, point_info, start_period, end_perio
if
len
(
negative
)
>
0
:
if
len
(
negative
)
>
0
:
push_point_info
(
substrate
,
negative_points_func
,
keypair
,
negative
)
push_point_info
(
substrate
,
negative_points_func
,
keypair
,
negative
)
with
open
(
"
/cmix/
raw_points
.
log
"
,
"
a
"
)
as
f
:
with
open
(
raw_points
_
log
,
"
a
"
)
as
f
:
f
.
write
(
f
"
[
{
datetime
.
datetime
.
now
()
}
]
{
raw_points
}
"
)
f
.
write
(
f
"
[
{
datetime
.
datetime
.
now
()
}
]
{
raw_points
}
"
)
# Save end_period timestamp to database to lock in the operation
# Save end_period timestamp to database to lock in the operation
...
@@ -395,12 +396,16 @@ def get_args():
...
@@ -395,12 +396,16 @@ def get_args():
get_args controls the argparse usage for the script. It sets up and parses
get_args controls the argparse usage for the script. It sets up and parses
arguments and returns them in dict format
arguments and returns them in dict format
"""
"""
global
raw_points_log
parser
=
argparse
.
ArgumentParser
(
description
=
"
Options for point assignment script
"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"
Options for point assignment script
"
)
parser
.
add_argument
(
"
--verbose
"
,
action
=
"
store_true
"
,
parser
.
add_argument
(
"
--verbose
"
,
action
=
"
store_true
"
,
help
=
"
Print debug logs
"
,
default
=
False
)
help
=
"
Print debug logs
"
,
default
=
False
)
parser
.
add_argument
(
"
--log
"
,
type
=
str
,
parser
.
add_argument
(
"
--log
"
,
type
=
str
,
help
=
"
Path to output log information
"
,
help
=
"
Path to output log information
"
,
default
=
"
/tmp/points.log
"
)
default
=
"
/tmp/points.log
"
)
parser
.
add_argument
(
"
--raw-points-log
"
,
type
=
str
,
help
=
"
Path to output log information
"
,
default
=
"
/cmix/raw-points.log
"
)
parser
.
add_argument
(
"
--xxdot-url
"
,
type
=
str
,
help
=
"
xxdot url
"
,
parser
.
add_argument
(
"
--xxdot-url
"
,
type
=
str
,
help
=
"
xxdot url
"
,
default
=
"
ws://localhost:9944
"
)
default
=
"
ws://localhost:9944
"
)
parser
.
add_argument
(
"
--xxdot-reg
"
,
type
=
str
,
help
=
"
xxdot registry file path
"
,
parser
.
add_argument
(
"
--xxdot-reg
"
,
type
=
str
,
help
=
"
xxdot registry file path
"
,
...
@@ -428,6 +433,7 @@ def get_args():
...
@@ -428,6 +433,7 @@ def get_args():
level
=
log
.
DEBUG
if
args
[
'
verbose
'
]
else
log
.
INFO
,
level
=
log
.
DEBUG
if
args
[
'
verbose
'
]
else
log
.
INFO
,
datefmt
=
'
%d-%b-%y %H:%M:%S
'
,
datefmt
=
'
%d-%b-%y %H:%M:%S
'
,
filename
=
args
[
"
log
"
])
filename
=
args
[
"
log
"
])
raw_points_log
=
args
[
'
raw_points_log
'
]
return
args
return
args
...
...
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