Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ExplorViz
explorviz-github-archive
analysis
Commits
95ea8347
Commit
95ea8347
authored
11 years ago
by
Florian Fittkau
Browse files
Options
Downloads
Patches
Plain Diff
added system monitoring (CPU, RAM)
parent
bf7cf5b3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Start Worker.launch
+15
-15
15 additions, 15 deletions
Start Worker.launch
src/explorviz/live_trace_processing/reader/TCPReaderOneClient.java
+30
-9
30 additions, 9 deletions
...rviz/live_trace_processing/reader/TCPReaderOneClient.java
with
45 additions
and
24 deletions
Start Worker.launch
+
15
−
15
View file @
95ea8347
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration
type=
"org.eclipse.jdt.launching.localJavaApplication"
>
<listAttribute
key=
"org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"
>
<listEntry
value=
"/worker/
src
/explorviz/worker/main/WorkerStarter.java"
/>
</listAttribute>
<listAttribute
key=
"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"
>
<listEntry
value=
"1"
/>
</listAttribute>
<listAttribute
key=
"org.eclipse.debug.ui.favoriteGroups"
>
<listEntry
value=
"org.eclipse.debug.ui.launchGroup.run"
/>
</listAttribute>
<stringAttribute
key=
"org.eclipse.jdt.launching.MAIN_TYPE"
value=
"explorviz.worker.main.WorkerStarter"
/>
<stringAttribute
key=
"org.eclipse.jdt.launching.PROJECT_ATTR"
value=
"worker"
/>
<stringAttribute
key=
"org.eclipse.jdt.launching.VM_ARGUMENTS"
value=
"-Xmx4G"
/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration
type=
"org.eclipse.jdt.launching.localJavaApplication"
>
<listAttribute
key=
"org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"
>
<listEntry
value=
"/worker/
test
/explorviz/worker/main/WorkerStarter.java"
/>
</listAttribute>
<listAttribute
key=
"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"
>
<listEntry
value=
"1"
/>
</listAttribute>
<listAttribute
key=
"org.eclipse.debug.ui.favoriteGroups"
>
<listEntry
value=
"org.eclipse.debug.ui.launchGroup.run"
/>
</listAttribute>
<stringAttribute
key=
"org.eclipse.jdt.launching.MAIN_TYPE"
value=
"explorviz.worker.main.WorkerStarter"
/>
<stringAttribute
key=
"org.eclipse.jdt.launching.PROJECT_ATTR"
value=
"worker"
/>
<stringAttribute
key=
"org.eclipse.jdt.launching.VM_ARGUMENTS"
value=
"-Xmx4G"
/>
</launchConfiguration>
This diff is collapsed.
Click to expand it.
src/explorviz/live_trace_processing/reader/TCPReaderOneClient.java
+
30
−
9
View file @
95ea8347
...
...
@@ -13,14 +13,13 @@ import com.lmax.disruptor.RingBuffer;
import
explorviz.live_trace_processing.filter.RecordArrayEvent
;
import
explorviz.live_trace_processing.filter.counting.CountingThroughputFilter
;
import
explorviz.live_trace_processing.reader.IPeriodicTimeSignalReceiver
;
import
explorviz.live_trace_processing.reader.TimeSignalReader
;
import
explorviz.live_trace_processing.record.IRecord
;
import
explorviz.live_trace_processing.record.event.normal.AfterFailedOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.normal.AfterOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.normal.BeforeOperationEventRecord
;
import
explorviz.live_trace_processing.record.misc.HostApplicationMetaDataRecord
;
import
explorviz.live_trace_processing.record.misc.StringRegistryRecord
;
import
explorviz.live_trace_processing.record.misc.SystemMonitoringRecord
;
import
explorviz.live_trace_processing.record.misc.TimedPeriodRecord
;
public
class
TCPReaderOneClient
extends
Thread
implements
IPeriodicTimeSignalReceiver
{
...
...
@@ -144,6 +143,16 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
}
break
;
}
case
SystemMonitoringRecord
.
CLAZZ_ID
:
{
if
(
buffer
.
remaining
()
>=
(
SystemMonitoringRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
-
1
))
{
readInSystemMonitoringRecord
(
buffer
);
}
else
{
buffer
.
position
(
buffer
.
position
()
-
1
);
buffer
.
compact
();
return
;
}
break
;
}
default
:
{
System
.
out
.
println
(
"unknown class id "
+
clazzId
+
" at offset "
+
(
buffer
.
position
()
-
4
));
...
...
@@ -167,7 +176,8 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
hostApplicationMetadata
=
new
HostApplicationMetaDataRecord
(
hostname
,
application
);
}
else
{
final
byte
[]
message
=
new
byte
[
HostApplicationMetaDataRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
];
buffer
.
position
(
buffer
.
position
()
-
HostApplicationMetaDataRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
);
buffer
.
position
(
buffer
.
position
()
-
HostApplicationMetaDataRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
);
buffer
.
get
(
message
);
putInWaitingMessages
(
message
);
}
...
...
@@ -182,11 +192,12 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
final
String
operation
=
getStringFromRegistry
(
operationId
);
if
(
operation
!=
null
)
{
putInRingBuffer
(
new
BeforeOperationEventRecord
(
timestamp
,
traceId
,
orderIndex
,
operationId
,
operation
));
putInRingBuffer
(
new
BeforeOperationEventRecord
(
timestamp
,
traceId
,
orderIndex
,
operationId
,
operation
));
}
else
{
final
byte
[]
message
=
new
byte
[
BeforeOperationEventRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
];
buffer
.
position
(
buffer
.
position
()
-
BeforeOperationEventRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
);
buffer
.
position
(
buffer
.
position
()
-
BeforeOperationEventRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
);
buffer
.
get
(
message
);
putInWaitingMessages
(
message
);
}
...
...
@@ -207,7 +218,8 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
operationId
,
operation
,
cause
));
}
else
{
final
byte
[]
message
=
new
byte
[
AfterFailedOperationEventRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
];
buffer
.
position
(
buffer
.
position
()
-
AfterFailedOperationEventRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
);
buffer
.
position
(
buffer
.
position
()
-
AfterFailedOperationEventRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
);
buffer
.
get
(
message
);
putInWaitingMessages
(
message
);
}
...
...
@@ -221,8 +233,8 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
final
String
operation
=
getStringFromRegistry
(
operationId
);
if
(
operation
!=
null
)
{
putInRingBuffer
(
new
AfterOperationEventRecord
(
timestamp
,
traceId
,
orderIndex
,
operationId
,
operation
));
putInRingBuffer
(
new
AfterOperationEventRecord
(
timestamp
,
traceId
,
orderIndex
,
operationId
,
operation
));
}
else
{
final
byte
[]
message
=
new
byte
[
AfterOperationEventRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
];
buffer
.
position
(
buffer
.
position
()
-
AfterOperationEventRecord
.
BYTE_LENGTH_WITH_CLAZZ_ID
);
...
...
@@ -232,6 +244,15 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
}
private
final
void
readInSystemMonitoringRecord
(
final
ByteBuffer
buffer
)
{
final
double
cpuUtil
=
buffer
.
getDouble
();
final
long
usedRAM
=
buffer
.
getLong
();
final
long
absoluteRAM
=
buffer
.
getLong
();
System
.
out
.
println
(
new
SystemMonitoringRecord
(
cpuUtil
,
usedRAM
,
absoluteRAM
).
toString
());
// putInRingBuffer(new SystemMonitoringRecord(cpuUtil, usedRAM,
// absoluteRAM));
}
private
final
void
putInWaitingMessages
(
final
byte
[]
message
)
{
waitingForStringMessages
.
add
(
message
);
}
...
...
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