Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gostatsd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
ale
gostatsd
Commits
33570415
Commit
33570415
authored
12 years ago
by
Kamil Kisiel
Browse files
Options
Downloads
Patches
Plain Diff
Moved stub server function to gostatsd.go main
parent
f744f49f
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
gostatsd/gostatsd.go
+19
-1
19 additions, 1 deletion
gostatsd/gostatsd.go
statsd/server.go
+0
-27
0 additions, 27 deletions
statsd/server.go
with
19 additions
and
28 deletions
gostatsd/gostatsd.go
+
19
−
1
View file @
33570415
...
...
@@ -29,8 +29,26 @@ func init() {
func
main
()
{
flag
.
Parse
()
err
:=
statsd
.
ListenAndServe
(
metricsAddr
,
consoleAddr
,
graphiteAddr
,
flushInterval
)
// Start the metric aggregator
graphite
,
err
:=
statsd
.
NewGraphiteClient
(
graphiteAddr
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
aggregator
:=
statsd
.
NewMetricAggregator
(
&
graphite
,
flushInterval
)
go
aggregator
.
Aggregate
()
// Start the metric receiver
f
:=
func
(
metric
statsd
.
Metric
)
{
aggregator
.
MetricChan
<-
metric
}
receiver
:=
statsd
.
MetricReceiver
{
metricsAddr
,
statsd
.
HandlerFunc
(
f
)}
go
receiver
.
ListenAndReceive
()
// Start the console
console
:=
statsd
.
ConsoleServer
{
consoleAddr
,
&
aggregator
}
go
console
.
ListenAndServe
()
// Listen forever
select
{}
}
This diff is collapsed.
Click to expand it.
statsd/server.go
deleted
100644 → 0
+
0
−
27
View file @
f744f49f
package
statsd
import
(
"time"
)
func
ListenAndServe
(
metricAddr
string
,
consoleAddr
string
,
graphiteAddr
string
,
flushInterval
time
.
Duration
)
error
{
graphite
,
err
:=
NewGraphiteClient
(
graphiteAddr
)
if
err
!=
nil
{
return
err
}
aggregator
:=
NewMetricAggregator
(
&
graphite
,
flushInterval
)
f
:=
func
(
metric
Metric
)
{
aggregator
.
MetricChan
<-
metric
}
receiver
:=
MetricReceiver
{
metricAddr
,
HandlerFunc
(
f
)}
console
:=
ConsoleServer
{
consoleAddr
,
&
aggregator
}
go
aggregator
.
Aggregate
()
go
receiver
.
ListenAndReceive
()
go
console
.
ListenAndServe
()
select
{}
return
nil
}
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