Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
ui-middleware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue 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
Open Source Software
OX App Suite
Core
ui-middleware
Commits
a738be84
Commit
a738be84
authored
1 year ago
by
kawa.acikgoez
Committed by
julian.baeume
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add: Gauge for Redis version
parent
adab68d1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cache.js
+10
-0
10 additions, 0 deletions
src/cache.js
src/version.js
+1
-1
1 addition, 1 deletion
src/version.js
with
11 additions
and
1 deletion
src/cache.js
+
10
−
0
View file @
a738be84
...
...
@@ -37,6 +37,16 @@ export const fileCacheSizeGauge = new Gauge({
help
:
'
Number of entries in file cache
'
})
export
const
versionCountGauge
=
new
Gauge
({
name
:
'
redis_version_count_gauge
'
,
help
:
'
Number of cache versions stored in Redis
'
,
async
collect
()
{
const
pattern
=
`
${
process
.
env
.
REDIS_PREFIX
}
:*:mergedMetadata`
const
results
=
await
redis
.
client
.
keys
(
pattern
)
this
.
set
(
results
.
length
)
}
})
export
function
set
(
key
,
value
,
timeout
)
{
logger
.
debug
(
`[Cache] Set
${
key
}
`
)
if
(
cache
[
key
]
===
value
)
return
...
...
This diff is collapsed.
Click to expand it.
src/version.js
+
1
−
1
View file @
a738be84
...
...
@@ -189,7 +189,7 @@ export async function updateVersionProcessor (pubClient) {
await
warmCache
({
version
:
fetchedVersionInfo
.
version
,
fetchFiles
:
true
})
await
redis
.
client
.
set
(
getRedisKey
({
name
:
'
versionInfo
'
}),
stringifiedVersionInfo
)
await
cache
.
get
(
getRedisKey
({
version
:
fetchedVersionInfo
.
version
,
name
:
'
mergedMetadata
'
}),
async
()
=>
[
await
fetchMergedMetadata
()])
versionUpdateGauge
.
setToCurrentTime
({
version
:
fetchVersionInfo
.
version
})
versionUpdateGauge
.
setToCurrentTime
({
version
:
fetch
ed
VersionInfo
.
version
})
logger
.
info
(
'
[Version] publish update to other nodes.
'
)
pubClient
.
publish
(
getRedisKey
({
name
:
'
updateVersionInfo
'
}),
stringifiedVersionInfo
)
}
else
{
...
...
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