Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCSG2003
Manage
Activity
Members
Plan
Wiki
Code
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
Analyze
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
Raphael Storm Larsen
DCSG2003
Commits
394b9dbd
Commit
394b9dbd
authored
2 years ago
by
Sara Stentvedt Luggenes
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of gitlab.stud.idi.ntnu.no:raphaesl/dcsg2003
parents
ba7a29e6
304c3be6
Branches
main
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configuration/manager/cron
+1
-1
1 addition, 1 deletion
configuration/manager/cron
configuration/manager/frontpage_scale.sh
+8
-0
8 additions, 0 deletions
configuration/manager/frontpage_scale.sh
with
9 additions
and
1 deletion
configuration/manager/cron
+
1
−
1
View file @
394b9dbd
...
...
@@ -6,4 +6,4 @@
0 8 * * * bash /home/ubuntu/dcsg2003/configuration/manager/backupDatabase.sh
* * * * * cp /home/ubuntu/dcsg2003/configuration/manager/.bashrc /home/ubuntu/.bashrc
* * * * * cp /home/ubuntu/dcsg2003/configuration/manager/.bashrc /root/.bashrc
0
* * * * bash /home/ubuntu/dcsg2003/configuration/manager/frontpage_scale.sh
*
* * * * bash /home/ubuntu/dcsg2003/configuration/manager/frontpage_scale.sh
This diff is collapsed.
Click to expand it.
configuration/manager/frontpage_scale.sh
+
8
−
0
View file @
394b9dbd
...
...
@@ -52,6 +52,7 @@ function scale {
# Safety valve is off, we're running the command
$SSH_COMMAND
$COMMAND
discord_log
"Scaling to
$1
frontpage users."
echo
"
$1
"
>
/home/ubuntu/logs/frontpage
else
# Saftey valve is on, we only print what we would do
...
...
@@ -78,6 +79,13 @@ fi
# Get current download times:
DOWNLOAD_TIME
=
$(
curl
-s
-g
'http://admin:admin@192.168.132.61:9090/api/v1/query?query=last_download_time{name="'
$COMPANY_NAME
'"}'
| jq
-r
'.data.result[].value[1] '
)
NUMBER_OF_FRONTPAGE_USERS
=
$(
curl
-s
-g
'http://admin:admin@192.168.132.61:9090/api/v1/query?query=frontpage_count{name="'
$COMPANY_NAME
'"}'
| jq
-r
'.data.result[].value[1] '
)
LOCAL_FRONTPAGE
=
$(
cat
/home/ubuntu/logs/frontpage
)
if
((
"
$NUMBER_OF_FRONTPAGE_USERS
"
!=
"
$LOCAL_FRONTPAGE
"
))
;
then
echo
"Frontpage count not aligned with local value."
exit
1
fi
echo
"Observed download time:
$DOWNLOAD_TIME
"
# check if we are below the lower threshold. If we are, we scale up
...
...
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