Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Server_Extension
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
BioinformaticDataCompression
BigDataViewer_Server_Extension
Commits
cfaf76be
Commit
cfaf76be
authored
10 years ago
by
HongKee Moon
Browse files
Options
Downloads
Patches
Plain Diff
Add "Number of datasets" and "Total size of datasets" in manager context
parent
fe54e0ee
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/bdv/server/ManagerHandler.java
+31
-11
31 additions, 11 deletions
src/main/java/bdv/server/ManagerHandler.java
src/main/resources/templates/manager.st
+8
-0
8 additions, 0 deletions
src/main/resources/templates/manager.st
with
39 additions
and
11 deletions
src/main/java/bdv/server/ManagerHandler.java
+
31
−
11
View file @
cfaf76be
...
@@ -15,6 +15,7 @@ import org.eclipse.jetty.util.log.Log;
...
@@ -15,6 +15,7 @@ import org.eclipse.jetty.util.log.Log;
import
javax.servlet.ServletException
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
import
java.net.URISyntaxException
;
import
java.net.URISyntaxException
;
...
@@ -34,6 +35,12 @@ public class ManagerHandler extends ContextHandler
...
@@ -34,6 +35,12 @@ public class ManagerHandler extends ContextHandler
private
final
ConnectorStatistics
connectorStats
;
private
final
ConnectorStatistics
connectorStats
;
private
String
contexts
=
null
;
private
int
noDataSets
=
0
;
private
long
sizeDataSets
=
0
;
public
ManagerHandler
(
final
String
baseURL
,
final
Server
server
,
final
ConnectorStatistics
connectorStats
,
final
StatisticsHandler
statHandler
,
ContextHandlerCollection
handlers
)
throws
IOException
,
URISyntaxException
public
ManagerHandler
(
final
String
baseURL
,
final
Server
server
,
final
ConnectorStatistics
connectorStats
,
final
StatisticsHandler
statHandler
,
ContextHandlerCollection
handlers
)
throws
IOException
,
URISyntaxException
{
{
this
.
baseURL
=
baseURL
;
this
.
baseURL
=
baseURL
;
...
@@ -105,28 +112,41 @@ public class ManagerHandler extends ContextHandler
...
@@ -105,28 +112,41 @@ public class ManagerHandler extends ContextHandler
t
.
setAttribute
(
"openConnections"
,
connectorStats
.
getConnectionsOpen
()
);
t
.
setAttribute
(
"openConnections"
,
connectorStats
.
getConnectionsOpen
()
);
t
.
setAttribute
(
"maxOpenConnections"
,
connectorStats
.
getConnectionsOpenMax
()
);
t
.
setAttribute
(
"maxOpenConnections"
,
connectorStats
.
getConnectionsOpenMax
()
);
t
.
setAttribute
(
"contexts"
,
getContexts
()
);
getContexts
();
t
.
setAttribute
(
"contexts"
,
contexts
);
t
.
setAttribute
(
"noDataSets"
,
noDataSets
);
t
.
setAttribute
(
"sizeDataSets"
,
getByteSizeString
(
sizeDataSets
)
);
t
.
setAttribute
(
"statHtml"
,
statHandler
.
toStatsHTML
()
);
t
.
setAttribute
(
"statHtml"
,
statHandler
.
toStatsHTML
()
);
return
t
.
toString
();
return
t
.
toString
();
}
}
private
String
getContexts
()
private
void
getContexts
()
{
{
StringBuilder
sb
=
new
StringBuilder
();
if
(
contexts
==
null
)
for
(
final
Handler
handler
:
server
.
getChildHandlersByClass
(
CellHandler
.
class
)
)
{
{
CellHandler
contextHandler
=
null
;
noDataSets
=
0
;
if
(
handler
instanceof
CellHandler
)
sizeDataSets
=
0
;
StringBuilder
sb
=
new
StringBuilder
();
for
(
final
Handler
handler
:
server
.
getChildHandlersByClass
(
CellHandler
.
class
)
)
{
{
sb
.
append
(
"<tr>\n<th>"
);
CellHandler
contextHandler
=
null
;
contextHandler
=
(
CellHandler
)
handler
;
if
(
handler
instanceof
CellHandler
)
sb
.
append
(
contextHandler
.
getContextPath
()
+
"</th>\n<td>"
);
{
sb
.
append
(
contextHandler
.
getXmlFile
()
+
"</td>\n</tr>\n"
);
sb
.
append
(
"<tr>\n<th>"
);
contextHandler
=
(
CellHandler
)
handler
;
sb
.
append
(
contextHandler
.
getContextPath
()
+
"</th>\n<td>"
);
sb
.
append
(
contextHandler
.
getXmlFile
()
+
"</td>\n</tr>\n"
);
noDataSets
++;
sizeDataSets
+=
new
File
(
contextHandler
.
getXmlFile
().
replace
(
".xml"
,
".h5"
)
).
length
();
}
}
}
contexts
=
sb
.
toString
();
}
}
return
sb
.
toString
();
}
}
private
void
deploy
(
final
String
datasetName
,
final
String
fileLocation
,
final
Request
baseRequest
,
final
HttpServletResponse
response
)
throws
IOException
private
void
deploy
(
final
String
datasetName
,
final
String
fileLocation
,
final
Request
baseRequest
,
final
HttpServletResponse
response
)
throws
IOException
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/manager.st
+
8
−
0
View file @
cfaf76be
...
@@ -43,6 +43,14 @@ This page is refreshed in every 5 secs.<br/>
...
@@ -43,6 +43,14 @@ This page is refreshed in every 5 secs.<br/>
<
th
>
Max
open
connections:
</
th
>
<
th
>
Max
open
connections:
</
th
>
<
td
>
$m
axOpenConnections
$<
/
td
>
<
td
>
$m
axOpenConnections
$<
/
td
>
</
tr
>
</
tr
>
<
tr
>
<
th
>
Number
of
datasets:
</
th
>
<
td
>
$n
oDataSets
$<
/
td
>
</
tr
>
<
tr
>
<
th
>
Total
size
of
datasets:
</
th
>
<
td
>
$s
izeDataSets
$<
/
td
>
</
tr
>
</
table
>
</
table
>
<
hr
>
<
hr
>
...
...
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