Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
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
Container 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
hive
hivemind
Commits
5c0b832e
Commit
5c0b832e
authored
4 years ago
by
Dariusz Kędzierski
Browse files
Options
Downloads
Patches
Plain Diff
Show additional info at startup: hivemind version and git rev, schema version and head block
parent
0bf4af70
No related branches found
No related tags found
4 merge requests
!456
Release candidate v1 24
,
!230
Setup monitoring with pghero
,
!135
Enable postgres monitoring on CI server
,
!70
Issue 51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hive/conf.py
+3
-2
3 additions, 2 deletions
hive/conf.py
hive/server/serve.py
+16
-0
16 additions, 0 deletions
hive/server/serve.py
with
19 additions
and
2 deletions
hive/conf.py
+
3
−
2
View file @
5c0b832e
...
@@ -65,8 +65,9 @@ class Conf():
...
@@ -65,8 +65,9 @@ class Conf():
from
sys
import
argv
from
sys
import
argv
root
.
info
(
"
Used command line args: %s
"
,
"
"
.
join
(
argv
[
1
:]))
root
.
info
(
"
Used command line args: %s
"
,
"
"
.
join
(
argv
[
1
:]))
args_list
=
[
"
--
"
+
k
+
"
"
+
str
(
v
)
for
k
,
v
in
vars
(
args
).
items
()]
# uncomment for full list of program args
root
.
info
(
"
Full command line args: %s
"
,
"
"
.
join
(
args_list
))
#args_list = ["--" + k + " " + str(v) for k,v in vars(args).items()]
#root.info("Full command line args: %s", " ".join(args_list))
if
conf
.
mode
()
==
'
server
'
:
if
conf
.
mode
()
==
'
server
'
:
#DbStats.SLOW_QUERY_MS = 750
#DbStats.SLOW_QUERY_MS = 750
...
...
This diff is collapsed.
Click to expand it.
hive/server/serve.py
+
16
−
0
View file @
5c0b832e
...
@@ -223,7 +223,23 @@ def run_server(conf):
...
@@ -223,7 +223,23 @@ def run_server(conf):
app
[
'
db
'
].
close
()
app
[
'
db
'
].
close
()
await
app
[
'
db
'
].
wait_closed
()
await
app
[
'
db
'
].
wait_closed
()
async
def
show_info
(
app
):
sql
=
"
SELECT num FROM hive_blocks ORDER BY num DESC LIMIT 1
"
database_head_block
=
await
app
[
'
db
'
].
query_one
(
sql
)
import
pkg_resources
hivemind_version
,
hivemind_git_rev
=
pkg_resources
.
get_distribution
(
"
hivemind
"
).
version
.
split
(
"
+
"
)
log
.
info
(
"
hivemind_version : %s
"
,
hivemind_version
)
log
.
info
(
"
hivemind_git_rev : %s
"
,
hivemind_git_rev
)
from
hive.db.schema
import
DB_VERSION
as
SCHEMA_DB_VERSION
log
.
info
(
"
database_schema_version : %s
"
,
SCHEMA_DB_VERSION
)
log
.
info
(
"
database_head_block : %s
"
,
database_head_block
)
app
.
on_startup
.
append
(
init_db
)
app
.
on_startup
.
append
(
init_db
)
app
.
on_startup
.
append
(
show_info
)
app
.
on_cleanup
.
append
(
close_db
)
app
.
on_cleanup
.
append
(
close_db
)
async
def
head_age
(
request
):
async
def
head_age
(
request
):
...
...
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