Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cachet-monitor
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
Service Desk
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
Janne Mareike Koschinski
cachet-monitor
Commits
5c4f0c2e
Commit
5c4f0c2e
authored
9 years ago
by
Matej Kramny
Browse files
Options
Downloads
Patches
Plain Diff
Print descriptions from cli
parent
9d0e1766
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cli/main.go
+16
-0
16 additions, 0 deletions
cli/main.go
monitor.go
+0
-17
0 additions, 17 deletions
monitor.go
with
16 additions
and
17 deletions
cli/main.go
+
16
−
0
View file @
5c4f0c2e
...
@@ -53,6 +53,22 @@ func main() {
...
@@ -53,6 +53,22 @@ func main() {
wg
:=
&
sync
.
WaitGroup
{}
wg
:=
&
sync
.
WaitGroup
{}
for
_
,
mon
:=
range
cfg
.
Monitors
{
for
_
,
mon
:=
range
cfg
.
Monitors
{
cfg
.
Logger
.
Printf
(
" Starting %s: %d seconds check interval
\n
- %v %s"
,
mon
.
Name
,
mon
.
CheckInterval
,
mon
.
Method
,
mon
.
URL
)
// print features
if
mon
.
ExpectedStatusCode
>
0
{
cfg
.
Logger
.
Printf
(
" - Expect HTTP %d"
,
mon
.
ExpectedStatusCode
)
}
if
len
(
mon
.
ExpectedBody
)
>
0
{
cfg
.
Logger
.
Printf
(
" - Expect Body to match
\"
%v
\"
"
,
mon
.
ExpectedBody
)
}
if
mon
.
MetricID
>
0
{
cfg
.
Logger
.
Printf
(
" - Log lag to metric id %d
\n
"
,
mon
.
MetricID
)
}
if
mon
.
ComponentID
>
0
{
cfg
.
Logger
.
Printf
(
" - Update component id %d
\n\n
"
,
mon
.
ComponentID
)
}
go
mon
.
Start
(
cfg
,
wg
)
go
mon
.
Start
(
cfg
,
wg
)
}
}
...
...
This diff is collapsed.
Click to expand it.
monitor.go
+
0
−
17
View file @
5c4f0c2e
...
@@ -48,23 +48,6 @@ func (mon *Monitor) Start(cfg *CachetMonitor, wg *sync.WaitGroup) {
...
@@ -48,23 +48,6 @@ func (mon *Monitor) Start(cfg *CachetMonitor, wg *sync.WaitGroup) {
wg
.
Add
(
1
)
wg
.
Add
(
1
)
mon
.
config
=
cfg
mon
.
config
=
cfg
mon
.
stopC
=
make
(
chan
bool
)
mon
.
stopC
=
make
(
chan
bool
)
mon
.
config
.
Logger
.
Printf
(
" Starting %s: %d seconds check interval
\n
- %v %s"
,
mon
.
Name
,
mon
.
CheckInterval
,
mon
.
Method
,
mon
.
URL
)
// print features
if
mon
.
ExpectedStatusCode
>
0
{
mon
.
config
.
Logger
.
Printf
(
" - Expect HTTP %d"
,
mon
.
ExpectedStatusCode
)
}
if
len
(
mon
.
ExpectedBody
)
>
0
{
mon
.
config
.
Logger
.
Printf
(
" - Expect Body to match
\"
%v
\"
"
,
mon
.
ExpectedBody
)
}
if
mon
.
MetricID
>
0
{
mon
.
config
.
Logger
.
Printf
(
" - Log lag to metric id %d
\n
"
,
mon
.
MetricID
)
}
if
mon
.
ComponentID
>
0
{
mon
.
config
.
Logger
.
Printf
(
" - Update component id %d
\n\n
"
,
mon
.
ComponentID
)
}
mon
.
Tick
()
mon
.
Tick
()
ticker
:=
time
.
NewTicker
(
mon
.
CheckInterval
*
time
.
Second
)
ticker
:=
time
.
NewTicker
(
mon
.
CheckInterval
*
time
.
Second
)
...
...
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