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
5574fcae
Commit
5574fcae
authored
11 years ago
by
phillu
Browse files
Options
Downloads
Patches
Plain Diff
added log statements
parent
89f424ec
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/explorviz/live_trace_processing/reader/TCPReader.java
+10
-4
10 additions, 4 deletions
src/explorviz/live_trace_processing/reader/TCPReader.java
src/explorviz/live_trace_processing/reader/TCPReaderOneClient.java
+10
-1
10 additions, 1 deletion
...rviz/live_trace_processing/reader/TCPReaderOneClient.java
with
20 additions
and
5 deletions
src/explorviz/live_trace_processing/reader/TCPReader.java
+
10
−
4
View file @
5574fcae
...
...
@@ -6,6 +6,9 @@ import java.nio.channels.ServerSocketChannel;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.lmax.disruptor.EventHandler
;
import
com.lmax.disruptor.RingBuffer
;
import
com.lmax.disruptor.dsl.Disruptor
;
...
...
@@ -17,6 +20,9 @@ import explorviz.live_trace_processing.filter.RecordArrayEventFactory;
import
explorviz.live_trace_processing.filter.reconstruction.ITraceReconstruction
;
public
final
class
TCPReader
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
TCPReader
.
class
);
private
final
int
listeningPort
;
private
boolean
active
=
true
;
...
...
@@ -50,12 +56,12 @@ public final class TCPReader {
threads
.
add
(
thread
);
}
}
catch
(
final
IOException
ex
)
{
System
.
out
.
println
(
"Error in read() "
+
ex
.
getMessage
());
LOG
.
info
(
"Error in read() "
+
ex
.
getMessage
());
}
finally
{
try
{
serversocket
.
close
();
}
catch
(
final
IOException
e
)
{
System
.
out
.
println
(
"Error in read()"
+
e
.
getMessage
());
LOG
.
info
(
"Error in read()"
+
e
.
getMessage
());
}
}
}
...
...
@@ -63,11 +69,11 @@ public final class TCPReader {
private
final
void
open
()
throws
IOException
{
serversocket
=
ServerSocketChannel
.
open
();
serversocket
.
socket
().
bind
(
new
InetSocketAddress
(
listeningPort
));
System
.
out
.
println
(
"
l
istening on port "
+
listeningPort
);
LOG
.
info
(
"
L
istening on port "
+
listeningPort
);
}
public
final
void
terminate
(
final
boolean
error
)
{
System
.
out
.
println
(
"Shutdown of TCPReader requested."
);
LOG
.
info
(
"Shutdown of TCPReader requested."
);
active
=
false
;
// for (final TCPReaderOneClient thread : threads) {
// thread.terminate();
...
...
This diff is collapsed.
Click to expand it.
src/explorviz/live_trace_processing/reader/TCPReaderOneClient.java
+
10
−
1
View file @
5574fcae
...
...
@@ -7,6 +7,9 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.lmax.disruptor.RingBuffer
;
import
explorviz.live_trace_processing.Constants
;
...
...
@@ -34,6 +37,9 @@ import explorviz.live_trace_processing.record.trace.HostApplicationMetaDataRecor
import
explorviz.live_trace_processing.record.trace.Trace
;
public
class
TCPReaderOneClient
extends
Thread
implements
IPeriodicTimeSignalReceiver
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
TCPReaderOneClient
.
class
);
private
HostApplicationMetaDataRecord
hostApplicationMetadata
;
private
final
StringRegistry
stringRegistry
=
new
StringRegistry
(
null
);
...
...
@@ -58,12 +64,15 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
public
void
run
()
{
final
ByteBuffer
buffer
=
ByteBuffer
.
allocateDirect
(
2
*
1024
*
1024
);
try
{
if
(
socketChannel
.
isConnected
())
{
LOG
.
info
(
"Client "
+
socketChannel
.
getRemoteAddress
()
+
" connected."
);
}
while
((
socketChannel
.
read
(
buffer
))
!=
-
1
)
{
buffer
.
flip
();
messagesfromByteArray
(
buffer
);
}
}
catch
(
final
IOException
ex
)
{
System
.
out
.
println
(
"Error in read() "
+
ex
.
getMessage
());
LOG
.
info
(
"Error in read() "
+
ex
.
getMessage
());
// TODO cancel timer???
}
}
...
...
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