Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
beem
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
hive
beem
Commits
f565c1a1
Commit
f565c1a1
authored
7 years ago
by
Holger Nahrstaedt
Browse files
Options
Downloads
Patches
Plain Diff
fix flake8
Parallel processing improved
parent
f3d5cf05
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
beem/blockchain.py
+1
-1
1 addition, 1 deletion
beem/blockchain.py
beemgrapheneapi/graphenerpc.py
+0
-1
0 additions, 1 deletion
beemgrapheneapi/graphenerpc.py
examples/benchmark_beem.py
+15
-15
15 additions, 15 deletions
examples/benchmark_beem.py
with
16 additions
and
17 deletions
beem/blockchain.py
+
1
−
1
View file @
f565c1a1
...
@@ -180,7 +180,7 @@ class Blockchain(object):
...
@@ -180,7 +180,7 @@ class Blockchain(object):
else
:
else
:
head_block
=
self
.
get_current_block_num
()
head_block
=
self
.
get_current_block_num
()
if
threading
and
FUTURES_MODULE
:
if
threading
and
FUTURES_MODULE
:
pool
=
ThreadPoolExecutor
(
2
)
pool
=
ThreadPoolExecutor
()
latest_block
=
0
latest_block
=
0
for
blocknum
in
range
(
start
,
head_block
+
1
,
thread_num
):
for
blocknum
in
range
(
start
,
head_block
+
1
,
thread_num
):
futures
=
[]
futures
=
[]
...
...
This diff is collapsed.
Click to expand it.
beemgrapheneapi/graphenerpc.py
+
0
−
1
View file @
f565c1a1
...
@@ -217,7 +217,6 @@ class GrapheneRPC(object):
...
@@ -217,7 +217,6 @@ class GrapheneRPC(object):
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
raise
raise
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"
error
"
+
str
(
e
))
log
.
critical
(
"
Error: {}n
\n
"
.
format
(
str
(
e
)))
log
.
critical
(
"
Error: {}n
\n
"
.
format
(
str
(
e
)))
sleep_and_check_retries
(
self
.
num_retries
,
cnt
,
self
.
url
)
sleep_and_check_retries
(
self
.
num_retries
,
cnt
,
self
.
url
)
# retry
# retry
...
...
This diff is collapsed.
Click to expand it.
examples/benchmark_beem.py
+
15
−
15
View file @
f565c1a1
...
@@ -17,33 +17,33 @@ logging.basicConfig(level=logging.INFO)
...
@@ -17,33 +17,33 @@ logging.basicConfig(level=logging.INFO)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
node_setup
=
2
node_setup
=
3
how_many_hours
=
1
how_many_hours
=
1
if
node_setup
==
0
:
if
node_setup
==
0
:
stm
=
Steem
(
node
=
"
https://api.steemit.com
"
,
num_retries
=
10
)
stm
=
Steem
(
node
=
"
https://api.steemit.com
"
,
num_retries
=
10
)
max_batch_size
=
None
max_batch_size
=
None
threading
=
True
threading
=
True
thread_num
=
8
thread_num
=
8
elif
node_setup
==
1
:
elif
node_setup
==
1
:
stm
=
Steem
(
node
=
"
https://api.steemitstage.com
"
,
num_retries
=
10
)
stm
=
Steem
(
node
=
"
https://api.steemitstage.com
"
,
num_retries
=
10
)
max_batch_size
=
16
max_batch_size
=
None
threading
=
False
threading
=
False
thread_num
=
8
thread_num
=
8
elif
node_setup
==
2
:
elif
node_setup
==
2
:
stm
=
Steem
(
node
=
"
https://api.steemitstage.com
"
,
num_retries
=
10
)
stm
=
Steem
(
node
=
"
https://api.steemitstage.com
"
,
num_retries
=
10
)
max_batch_size
=
None
max_batch_size
=
None
threading
=
True
threading
=
True
thread_num
=
8
thread_num
=
8
elif
node_setup
==
3
:
elif
node_setup
==
3
:
stm
=
Steem
(
num_retries
=
10
)
stm
=
Steem
(
num_retries
=
10
)
max_batch_size
=
None
max_batch_size
=
None
threading
=
True
threading
=
True
thread_num
=
8
thread_num
=
16
blockchain
=
Blockchain
(
steem_instance
=
stm
)
blockchain
=
Blockchain
(
steem_instance
=
stm
)
last_block_id
=
19273700
last_block_id
=
19273700
last_block
=
Block
(
last_block_id
,
steem_instance
=
stm
)
last_block
=
Block
(
last_block_id
,
steem_instance
=
stm
)
startTime
=
datetime
.
now
()
startTime
=
datetime
.
now
()
stopTime
=
last_block
.
time
()
+
timedelta
(
seconds
=
how_many_hours
*
60
*
60
)
stopTime
=
last_block
.
time
()
+
timedelta
(
seconds
=
how_many_hours
*
60
*
60
)
ltime
=
time
.
time
()
ltime
=
time
.
time
()
cnt
=
0
cnt
=
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