-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
209 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
...l.profiler/src/net/sf/eclipsefp/haskell/profiler/internal/parser/ProfilingOutputParser.jj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
net.sf.eclipsefp.haskell.profiler/src/net/sf/eclipsefp/haskell/profiler/model/Job.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package net.sf.eclipsefp.haskell.profiler.model; | ||
|
||
import java.io.InputStream; | ||
import java.io.Reader; | ||
import java.util.Collection; | ||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
import net.sf.eclipsefp.haskell.profiler.internal.parser.ParseException; | ||
import net.sf.eclipsefp.haskell.profiler.internal.parser.ProfilingOutputParser; | ||
|
||
public class Job { | ||
String name; | ||
String date; | ||
String sampleUnit; | ||
String valueUnit; | ||
LinkedHashMap<Float, Sample> samples; | ||
|
||
public Job(String name, String date, String sampleUnit, String valueUnit) { | ||
this.name = name; | ||
this.date = date; | ||
this.sampleUnit = sampleUnit; | ||
this.valueUnit = valueUnit; | ||
this.samples = new LinkedHashMap<Float, Sample>(); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getDate() { | ||
return date; | ||
} | ||
|
||
public String getSampleUnit() { | ||
return sampleUnit; | ||
} | ||
|
||
public String getValueUnit() { | ||
return valueUnit; | ||
} | ||
|
||
public Set<Map.Entry<Float, Sample>> getSamplesAndTimes() { | ||
return samples.entrySet(); | ||
} | ||
|
||
public Collection<Sample> getSamples() { | ||
return samples.values(); | ||
} | ||
|
||
public void addSample(Sample sample) { | ||
samples.put(sample.getTime(), sample); | ||
} | ||
|
||
public static Job parse(InputStream stream) throws ParseException { | ||
ProfilingOutputParser parser = new ProfilingOutputParser(stream); | ||
return parser.job(); | ||
} | ||
|
||
public static Job parse(Reader stream) throws ParseException { | ||
ProfilingOutputParser parser = new ProfilingOutputParser(stream); | ||
return parser.job(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
net.sf.eclipsefp.haskell.profiler/src/net/sf/eclipsefp/haskell/profiler/model/Sample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.sf.eclipsefp.haskell.profiler.model; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class Sample { | ||
float time; | ||
LinkedHashMap<String, Long> entries; | ||
|
||
public Sample(float time) { | ||
this.time = time; | ||
this.entries = new LinkedHashMap<String, Long>(); | ||
} | ||
|
||
public float getTime() { | ||
return time; | ||
} | ||
|
||
public void addEntry(String name, long value) { | ||
entries.put(name, value); | ||
} | ||
|
||
public Set<Map.Entry<String, Long>> getEntries() { | ||
return entries.entrySet(); | ||
} | ||
} |