Commit e8b8bd29 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

unify microsecond precision.


Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent 931f2030
...@@ -1058,7 +1058,7 @@ public final class LoggerPluginManager { ...@@ -1058,7 +1058,7 @@ public final class LoggerPluginManager {
private void fill_common_fields(final TitanLogEvent event, final Severity severity) { private void fill_common_fields(final TitanLogEvent event, final Severity severity) {
final long timestamp = System.currentTimeMillis(); final long timestamp = System.currentTimeMillis();
event.get_field_timestamp__().operator_assign(new TimestampType(new TitanInteger(BigInteger.valueOf(timestamp / 1000)), new TitanInteger((int)(timestamp % 1000)))); event.get_field_timestamp__().operator_assign(new TimestampType(new TitanInteger(BigInteger.valueOf(timestamp / 1000)), new TitanInteger((int)(timestamp % 1000) * 1000)));
final TitanLogEvent_sourceInfo__list srcinfo = event.get_field_sourceInfo__list(); final TitanLogEvent_sourceInfo__list srcinfo = event.get_field_sourceInfo__list();
if (TTCN_Location.actualSize.get() == 0) { if (TTCN_Location.actualSize.get() == 0) {
......
...@@ -674,7 +674,7 @@ public final class TTCN_Communication { ...@@ -674,7 +674,7 @@ public final class TTCN_Communication {
final String componentName, final String componentLocation, final boolean is_alive, final String componentName, final String componentLocation, final boolean is_alive,
final double testcase_start_time) { final double testcase_start_time) {
final long seconds = (long)testcase_start_time; final long seconds = (long)testcase_start_time;
final int miliseconds = (int)((testcase_start_time - seconds) * 1000); final int microseconds = (int)((testcase_start_time - seconds) * 1000);
final Text_Buf text_buf = new Text_Buf(); final Text_Buf text_buf = new Text_Buf();
text_buf.push_int(MSG_CREATE_REQ); text_buf.push_int(MSG_CREATE_REQ);
...@@ -687,7 +687,7 @@ public final class TTCN_Communication { ...@@ -687,7 +687,7 @@ public final class TTCN_Communication {
final int lower_int = (int)(seconds % 0xffffffff); final int lower_int = (int)(seconds % 0xffffffff);
text_buf.push_int(upper_int); text_buf.push_int(upper_int);
text_buf.push_int(lower_int); text_buf.push_int(lower_int);
text_buf.push_int(miliseconds); text_buf.push_int(microseconds);
send_message(text_buf); send_message(text_buf);
} }
...@@ -1160,10 +1160,10 @@ public final class TTCN_Communication { ...@@ -1160,10 +1160,10 @@ public final class TTCN_Communication {
final int upper_int = local_incoming_buf.pull_int().get_int(); final int upper_int = local_incoming_buf.pull_int().get_int();
final int lower_int = local_incoming_buf.pull_int().get_int(); final int lower_int = local_incoming_buf.pull_int().get_int();
final long seconds = upper_int * 0xffffffff + lower_int; final long seconds = upper_int * 0xffffffff + lower_int;
final int milliSeconds = local_incoming_buf.pull_int().get_int(); final int microSeconds = local_incoming_buf.pull_int().get_int();
local_incoming_buf.cut_message(); local_incoming_buf.cut_message();
final double start_time = seconds + milliSeconds / 1000.0; final double start_time = seconds + microSeconds / 1000000.0;
TTCN_Runtime.process_create_ptc(component_reference, component_module_name, component_definition_name, system_module_name, system_definition_name, component_name, is_alive, testcase_module_name, testcase_definition_name, start_time); TTCN_Runtime.process_create_ptc(component_reference, component_module_name, component_definition_name, system_module_name, system_definition_name, component_name, is_alive, testcase_module_name, testcase_definition_name, start_time);
} }
......
...@@ -406,7 +406,7 @@ public class MainController { ...@@ -406,7 +406,7 @@ public class MainController {
private volatile boolean any_component_killed_requested; private volatile boolean any_component_killed_requested;
private volatile boolean all_component_killed_requested; private volatile boolean all_component_killed_requested;
private long testcase_start_time_seconds;// testcase_start_time private long testcase_start_time_seconds;// testcase_start_time
private int testcase_start_time_miliseconds; private int testcase_start_time_microseconds;
private volatile boolean stop_requested; private volatile boolean stop_requested;
private volatile boolean stop_after_tc; private volatile boolean stop_after_tc;
...@@ -1811,7 +1811,7 @@ public class MainController { ...@@ -1811,7 +1811,7 @@ public class MainController {
final int upper_int = text_buf.pull_int().get_int(); final int upper_int = text_buf.pull_int().get_int();
final int lower_int = text_buf.pull_int().get_int(); final int lower_int = text_buf.pull_int().get_int();
testcase_start_time_seconds = upper_int * 0xffffffff + lower_int; testcase_start_time_seconds = upper_int * 0xffffffff + lower_int;
testcase_start_time_miliseconds = text_buf.pull_int().get_int(); testcase_start_time_microseconds = text_buf.pull_int().get_int();
final Host ptcLoc = choose_ptc_location(componentTypeName, componentName, componentLocation); final Host ptcLoc = choose_ptc_location(componentTypeName, componentName, componentLocation);
if (ptcLoc == null) { if (ptcLoc == null) {
...@@ -1935,7 +1935,7 @@ public class MainController { ...@@ -1935,7 +1935,7 @@ public class MainController {
final int lower_int = (int)(testcase_start_time_seconds % 0xffffffff); final int lower_int = (int)(testcase_start_time_seconds % 0xffffffff);
text_buf.push_int(upper_int); text_buf.push_int(upper_int);
text_buf.push_int(lower_int); text_buf.push_int(lower_int);
text_buf.push_int(testcase_start_time_miliseconds); text_buf.push_int(testcase_start_time_microseconds);
send_message(host.socket, text_buf); send_message(host.socket, text_buf);
} }
...@@ -5827,7 +5827,7 @@ public class MainController { ...@@ -5827,7 +5827,7 @@ public class MainController {
final int length = text_buf.pull_int().get_int(); final int length = text_buf.pull_int().get_int();
final byte messageBytes[] = new byte[length]; final byte messageBytes[] = new byte[length];
text_buf.pull_raw(length, messageBytes); text_buf.pull_raw(length, messageBytes);
notify(seconds * 1000 + microseconds, source, severity, new String(messageBytes)); notify(seconds * 1000 + microseconds / 1000, source, severity, new String(messageBytes));
} }
private void process_log(final Host hc) { private void process_log(final Host hc) {
...@@ -5842,7 +5842,7 @@ public class MainController { ...@@ -5842,7 +5842,7 @@ public class MainController {
final int length = text_buf.pull_int().get_int(); final int length = text_buf.pull_int().get_int();
final byte messageBytes[] = new byte[length]; final byte messageBytes[] = new byte[length];
text_buf.pull_raw(length, messageBytes); text_buf.pull_raw(length, messageBytes);
notify(seconds * 1000 + microseconds, hc.log_source, severity, new String(messageBytes)); notify(seconds * 1000 + microseconds / 1000, hc.log_source, severity, new String(messageBytes));
} }
private void process_log(final ComponentStruct tc) { private void process_log(final ComponentStruct tc) {
...@@ -5856,7 +5856,7 @@ public class MainController { ...@@ -5856,7 +5856,7 @@ public class MainController {
final int length = text_buf.pull_int().get_int(); final int length = text_buf.pull_int().get_int();
final byte messageBytes[] = new byte[length]; final byte messageBytes[] = new byte[length];
text_buf.pull_raw(length, messageBytes); text_buf.pull_raw(length, messageBytes);
notify(seconds * 1000 + microseconds, tc.log_source, severity, new String(messageBytes)); notify(seconds * 1000 + microseconds / 1000, tc.log_source, severity, new String(messageBytes));
} }
public void execute_testcase(final String moduleName, final String testcaseName) { public void execute_testcase(final String moduleName, final String testcaseName) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment