Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
4f6fdd86
Commit
4f6fdd86
authored
Mar 13, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring the ci metrics a bit more making it easier to re-use
parent
aa6a9329
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
17 deletions
+43
-17
scripts/ci-frontend-metrics.sh
+13
-11
scripts/ci-metrics-publisher.sh
+18
-0
scripts/circle-test-frontend.sh
+12
-6
No files found.
scripts/ci
rcle
-metrics.sh
→
scripts/ci
-frontend
-metrics.sh
View file @
4f6fdd86
#!/bin/bash
echo
"Collecting code stats (typescript errors & more)"
echo
-e
"Collecting code stats (typescript errors & more)"
ERROR_COUNT
=
"
$(
./node_modules/.bin/tsc
--project
tsconfig.json
--noEmit
--noImplicitAny
true
|
grep
-oP
'Found \K(\d+)'
)
"
DIRECTIVES
=
"
$(
grep
-r
-o
directive public/app/
**
/
*
| wc
-l
)
"
CONTROLLERS
=
"
$(
grep
-r
-oP
'class .*Ctrl'
public/app/
**
/
*
| wc
-l
)
"
echo
"Typescript errors:
$ERROR_COUNT
"
echo
"Directives:
$DIRECTIVES
"
echo
"Controllers:
$CONTROLLERS
"
echo
-e
"Typescript errors:
$ERROR_COUNT
"
echo
-e
"Directives:
$DIRECTIVES
"
echo
-e
"Controllers:
$CONTROLLERS
"
curl
\
-d
"{
\"
metrics
\"
: {
...
...
@@ -21,10 +21,12 @@ curl \
-u
ci:
$CIRCLE_STATS_PWD
\
-X
POST https://stats.grafana.org/metric-receiver
curl https://6371:
$GRAFANA_MISC_STATS_API_KEY
@graphite-us-central1.grafana.net/metrics
\
-H
'Content-type: application/json'
\
-d
'[
{"name":"grafana.ci-code.noImplicitAny", "interval":60, "value": '
$ERROR_COUNT
', "mtype": "gauge", "time": '
$(
date +%s
)
'},
{"name":"grafana.ci-code.directives", "interval":60, "value": '
$DIRECTIVES
', "mtype": "gauge", "time": '
$(
date +%s
)
'},
{"name":"grafana.ci-code.controllers", "interval":60, "value": '
$CONTROLLERS
', "mtype": "gauge", "time": '
$(
date +%s
)
'}
]'
echo
-e
""
./scripts/ci-metrics-publisher.sh
\
grafana.ci-code.noImplicitAny
=
$ERROR_COUNT
\
grafana.ci-code.directives
=
$DIRECTIVES
\
grafana.ci-code.controllers
=
$CONTROLLERS
\
scripts/ci-metrics-publisher.sh
0 → 100755
View file @
4f6fdd86
#!/bin/bash
echo
"Publishing CI Metrics"
data
=
""
for
((
i
=
1
;
i <
=
$#;
i++
))
;
do
remainder
=
"
${
!i
}
"
first
=
"
${
remainder
%%=*
}
"
;
remainder
=
"
${
remainder
#*=
}
"
if
[
-n
"
$data
"
]
;
then
data
=
"
$data
,"
fi
data
=
''
$data
'{"name": "'
${
first
}
'", "value": '
${
remainder
}
', "interval": 60, "mtype": "gauge", "time": '
$(
date +%s
)
'}'
done
curl https://6371:
$GRAFANA_MISC_STATS_API_KEY
@graphite-us-central1.grafana.net/metrics
\
-H
'Content-type: application/json'
\
-d
"[
$data
]"
scripts/circle-test-frontend.sh
View file @
4f6fdd86
#!/bin/bash
function
exit_if_fail
{
command
=
$@
echo
"Executing '
$command
'"
...
...
@@ -10,11 +11,16 @@ function exit_if_fail {
fi
}
start
=
$(
date +%s
)
exit_if_fail npm run prettier:check
exit_if_fail npm run
test
# exit_if_fail npm run test
end
=
$(
date +%s
)
seconds
=
$((
end
-
start
))
# if [ "${CIRCLE_BRANCH}" == "master" ]; then
exit_if_fail ./scripts/ci-frontend-metrics.sh
exit_if_fail ./scripts/ci-metrics-publisher.sh grafana.ci-performance.frontend-tests
=
$seconds
# fi
# On master also collect some and send some metrics
branch
=
"
$(
git rev-parse
--abbrev-ref
HEAD
)
"
if
[
"
${
branch
}
"
==
"master"
]
;
then
exit_if_fail ./scripts/circle-metrics.sh
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment