svn path=/branches/dmsnell/heap-buddy/; revision=63420
This commit is contained in:
dsnell 2006-08-07 02:15:22 +00:00
Родитель 9570c20d5c
Коммит e11b614f38
3 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -29,7 +29,7 @@ namespace HeapBuddy {
private ArrayList Stamps;
public MemGraph (OutfileReader reader)
public MemGraph (OutfileReader reader, string filename)
{
Stamps = new ArrayList ();
CollectStamps (reader);
@ -88,12 +88,13 @@ namespace HeapBuddy {
foreach (MemStamp ms in Stamps) {
c.LineTo (GraphOriginX + (double)(ms.TimeT - lowTime) / xscale, GraphOriginY + GraphHeight - (double)(ms.LiveBytes - lowBytes) / yscale);
}
c.LineWidth = 4;
c.LineWidth = 1.5;
c.Stroke ();
// Draw the Memory Text
// Tick Marks...
c.FontSize = 15;
c.LineWidth = 1;
for (int i = 0; i <= 10; i++) {
c.MoveTo (GraphOriginX - 5, GraphOriginY + GraphHeight - i * GraphHeight / 10);
@ -118,7 +119,10 @@ namespace HeapBuddy {
c.ShowText (s);
}
surface.WriteToPng ("memgraph.png");
if (filename == null)
filename = "memlog.png";
surface.WriteToPng (filename);
surface.Finish ();
}

Просмотреть файл

@ -203,6 +203,7 @@ namespace HeapBuddy {
Console.WriteLine ("Memlog commands:");
Console.WriteLine (" list: list the items in the current path");
Console.WriteLine (" rows [n]: specify how many rows to print - zero for all");
Console.WriteLine (" graph [filename]: generate graph of memory usage (memlog.png default)");
Console.WriteLine (" help: show this screen");
Console.WriteLine (" quit: quit");
}
@ -280,7 +281,11 @@ namespace HeapBuddy {
case "graph":
MemGraph graph = new MemGraph (reader);
string filename = null;
if (i + 1 < cmds.Length)
filename = cmds[++i];
MemGraph graph = new MemGraph (reader, filename);
break;

Просмотреть файл

@ -65,7 +65,10 @@ namespace HeapBuddy {
if (seconds < 3600)
return String.Format ("{0:0.0}m", (float)seconds / 60.0);
return String.Format ("{0:0.0}h", (float)seconds / 3600.0);
if (seconds < 3600 * 24)
return String.Format ("{0:0.0}h", (float)seconds / 3600.0);
return String.Format ("{0:0.0}d", (float)seconds / (3600.0 * 24));
}
static public string PrettySize (uint num_bytes)