Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
pankaj
2014-10-08 10:21:29 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9c060c09ef10e7fa0db84daf7af248d1397be1a0
9c060c09
1 parent
8e939d82
Report metrics to log
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyClientCommand.java
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyServer.java
utils/misc/src/main/java/org/onlab/metrics/MetricsManager.java
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyClientCommand.java
View file @
9c060c0
...
...
@@ -24,7 +24,7 @@ public class SimpleNettyClientCommand extends AbstractShellCommand {
@Argument
(
index
=
1
,
name
=
"warmupCount"
,
description
=
"Warm-up count"
,
required
=
false
,
multiValued
=
false
)
String
warmup
=
"1000
0
"
;
String
warmup
=
"1000"
;
@Argument
(
index
=
2
,
name
=
"messageCount"
,
description
=
"Message count"
,
required
=
false
,
multiValued
=
false
)
...
...
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyServer.java
View file @
9c060c0
...
...
@@ -8,7 +8,7 @@ import org.slf4j.LoggerFactory;
* Test to measure Messaging performance.
*/
public
final
class
SimpleNettyServer
{
private
static
Logger
log
=
LoggerFactory
.
getLogger
(
IOLoopTest
Server
.
class
);
private
static
Logger
log
=
LoggerFactory
.
getLogger
(
SimpleNetty
Server
.
class
);
private
SimpleNettyServer
()
{}
...
...
utils/misc/src/main/java/org/onlab/metrics/MetricsManager.java
View file @
9c060c0
...
...
@@ -8,8 +8,9 @@ import java.util.concurrent.TimeUnit;
import
org.apache.felix.scr.annotations.Activate
;
import
org.apache.felix.scr.annotations.Component
;
import
org.apache.felix.scr.annotations.Deactivate
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.codahale.metrics.ConsoleReporter
;
import
com.codahale.metrics.Counter
;
import
com.codahale.metrics.Gauge
;
import
com.codahale.metrics.Histogram
;
...
...
@@ -17,6 +18,7 @@ import com.codahale.metrics.Meter;
import
com.codahale.metrics.Metric
;
import
com.codahale.metrics.MetricFilter
;
import
com.codahale.metrics.MetricRegistry
;
import
com.codahale.metrics.Slf4jReporter
;
import
com.codahale.metrics.Timer
;
/**
...
...
@@ -54,6 +56,7 @@ import com.codahale.metrics.Timer;
@Component
(
immediate
=
true
)
public
final
class
MetricsManager
implements
MetricsService
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
getClass
());
/**
* Registry to hold the Components defined in the system.
*/
...
...
@@ -67,14 +70,16 @@ public final class MetricsManager implements MetricsService {
/**
* Default Reporter for this metrics manager.
*/
private
final
Console
Reporter
reporter
;
private
final
Slf4j
Reporter
reporter
;
public
MetricsManager
()
{
this
.
metricsRegistry
=
new
MetricRegistry
();
this
.
reporter
=
ConsoleReporter
.
forRegistry
(
metricsRegistry
)
this
.
reporter
=
Slf4jReporter
.
forRegistry
(
this
.
metricsRegistry
)
.
outputTo
(
log
)
.
convertRatesTo
(
TimeUnit
.
SECONDS
)
.
convertDurationsTo
(
TimeUnit
.
MI
CRO
SECONDS
)
.
convertDurationsTo
(
TimeUnit
.
MI
LLI
SECONDS
)
.
build
();
reporter
.
start
(
1
,
TimeUnit
.
MINUTES
);
}
@Activate
...
...
Please
register
or
login
to post a comment