Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
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
Model registry
Operate
Environments
Monitor
Incidents
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
croft1
floodlight
Commits
835eeebb
Commit
835eeebb
authored
11 years ago
by
Saurav Das
Browse files
Options
Downloads
Patches
Plain Diff
First checkin for debugCounters cli.
Flattened debug counters REST output a little bit.
parent
c45051bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/debugcounter/web/DebugCounterResource.java
+50
-6
50 additions, 6 deletions
...ightcontroller/debugcounter/web/DebugCounterResource.java
with
50 additions
and
6 deletions
src/main/java/net/floodlightcontroller/debugcounter/web/DebugCounterResource.java
+
50
−
6
View file @
835eeebb
...
...
@@ -11,6 +11,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
net.floodlightcontroller.debugcounter.DebugCounter.DebugCounterInfo
;
import
net.floodlightcontroller.debugcounter.IDebugCounterService.CounterType
;
/**
* Web interface for Debug Counters
...
...
@@ -24,15 +25,59 @@ public class DebugCounterResource extends DebugCounterResourceBase {
/**
* The output JSON model that contains the counter information
*/
public
static
class
DebugCounterInfoOutput
{
public
Map
<
String
,
DebugCounterInfo
>
counterMap
;
public
class
DebugCounterInfoOutput
{
protected
class
DCInfo
{
private
final
Long
counterValue
;
private
final
CounterType
cType
;
private
final
String
counterDesc
;
private
final
boolean
enabled
;
private
final
String
counterHierarchy
;
private
final
String
moduleName
;
DCInfo
(
DebugCounterInfo
dci
)
{
this
.
moduleName
=
dci
.
getCounterInfo
().
getModuleName
();
this
.
counterHierarchy
=
dci
.
getCounterInfo
().
getCounterHierarchy
();
this
.
counterDesc
=
dci
.
getCounterInfo
().
getCounterHierarchy
();
//this.metaData = dci.getCounterInfo().getMetaData();
this
.
enabled
=
dci
.
getCounterInfo
().
isEnabled
();
this
.
cType
=
dci
.
getCounterInfo
().
getCtype
();
this
.
counterValue
=
dci
.
getCounterValue
();
}
public
Long
getCounterValue
()
{
return
counterValue
;
}
public
CounterType
getcType
()
{
return
cType
;
}
public
String
getCounterDesc
()
{
return
counterDesc
;
}
public
boolean
isEnabled
()
{
return
enabled
;
}
public
String
getCounterHierarchy
()
{
return
counterHierarchy
;
}
public
String
getModuleName
()
{
return
moduleName
;
}
}
public
Map
<
String
,
DCInfo
>
counterMap
;
public
String
error
;
DebugCounterInfoOutput
()
{
counterMap
=
new
HashMap
<
String
,
D
ebugCounter
Info
>();
counterMap
=
new
HashMap
<
String
,
D
C
Info
>();
error
=
null
;
}
public
Map
<
String
,
D
ebugCounter
Info
>
getCounterMap
()
{
public
Map
<
String
,
D
C
Info
>
getCounterMap
()
{
return
counterMap
;
}
...
...
@@ -215,7 +260,6 @@ public class DebugCounterResource extends DebugCounterResourceBase {
public
DebugCounterInfoOutput
handleCounterInfoQuery
()
{
DebugCounterInfoOutput
output
=
new
DebugCounterInfoOutput
();
Option
choice
=
Option
.
ERROR_BAD_PARAM
;
String
param1
=
(
String
)
getRequestAttributes
().
get
(
"param1"
);
String
param2
=
(
String
)
getRequestAttributes
().
get
(
"param2"
);
String
param3
=
(
String
)
getRequestAttributes
().
get
(
"param3"
);
...
...
@@ -285,7 +329,7 @@ public class DebugCounterResource extends DebugCounterResourceBase {
if
(
debugCounterInfo
!=
null
)
output
.
counterMap
.
put
(
debugCounterInfo
.
getCounterInfo
().
getModuleCounterHierarchy
(),
debugCounterInfo
);
output
.
new
DCInfo
(
debugCounterInfo
)
)
;
}
private
void
populateCounters
(
List
<
DebugCounterInfo
>
counterValues
,
...
...
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