Skip to content

Commit

Permalink
Updates Google Cluster Reader classes to
Browse files Browse the repository at this point in the history
deal with timestamp values as double.
This way, if such values are changed during pre-processing
phase so that the result value is larger than an int,
they will be read as double to avoid overflow.

Since such values are converted from microseconds (the unit in trace files)
to seconds (the unit used by CloudSim Plus), the final result is double
anyway.

Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
  • Loading branch information
manoelcampos committed Oct 1, 2018
1 parent 47edf4b commit f987865
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public enum FieldIndex implements TraceField<GoogleTaskEventsTraceReader> {
*/
@Override
public Double getValue(final GoogleTaskEventsTraceReader reader) {
return Conversion.microToSeconds(reader.getFieldIntValue(this));
return Conversion.microToSeconds(reader.getFieldDoubleValue(this));
}
},

Expand Down Expand Up @@ -400,7 +400,7 @@ public Set<Cloudlet> process() {
}

/**
* There is not pre-process for this implementation.
* There is no pre-process requirements for this implementation.
*/
@Override
protected void preProcess(){/**/}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public enum FieldIndex implements TraceField<GoogleTaskUsageTraceReader> {
*/
@Override
public Double getValue(final GoogleTaskUsageTraceReader reader) {
return Conversion.microToSeconds(reader.getFieldIntValue(this));
return Conversion.microToSeconds(reader.getFieldDoubleValue(this));
}
},

Expand All @@ -100,7 +100,7 @@ public Double getValue(final GoogleTaskUsageTraceReader reader) {
*/
@Override
public Double getValue(final GoogleTaskUsageTraceReader reader) {
return Conversion.microToSeconds(reader.getFieldIntValue(this));
return Conversion.microToSeconds(reader.getFieldDoubleValue(this));
}
},

Expand Down

0 comments on commit f987865

Please sign in to comment.