Author: dsnell
Date: 2006-08-06 22:15:22 -0400 (Sun, 06 Aug 2006)
New Revision: 63420

Modified:
   branches/dmsnell/heap-buddy/analyzer/MemGraph.cs
   branches/dmsnell/heap-buddy/analyzer/MemlogReport.cs
   branches/dmsnell/heap-buddy/analyzer/Util.cs
Log:
More prettiness


Modified: branches/dmsnell/heap-buddy/analyzer/MemGraph.cs
===================================================================
--- branches/dmsnell/heap-buddy/analyzer/MemGraph.cs    2006-08-06 23:24:01 UTC 
(rev 63419)
+++ branches/dmsnell/heap-buddy/analyzer/MemGraph.cs    2006-08-07 02:15:22 UTC 
(rev 63420)
@@ -29,7 +29,7 @@
                
                private ArrayList Stamps;
 
-               public MemGraph (OutfileReader reader)
+               public MemGraph (OutfileReader reader, string filename)
                {       
                        Stamps = new ArrayList ();
                        CollectStamps (reader);
@@ -88,12 +88,13 @@
                        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 @@
                                c.ShowText (s);
                        }
                                
-                       surface.WriteToPng ("memgraph.png");
+                       if (filename == null)
+                               filename = "memlog.png";
+                               
+                       surface.WriteToPng (filename);
                        surface.Finish ();
                }
                

Modified: branches/dmsnell/heap-buddy/analyzer/MemlogReport.cs
===================================================================
--- branches/dmsnell/heap-buddy/analyzer/MemlogReport.cs        2006-08-06 
23:24:01 UTC (rev 63419)
+++ branches/dmsnell/heap-buddy/analyzer/MemlogReport.cs        2006-08-07 
02:15:22 UTC (rev 63420)
@@ -203,6 +203,7 @@
                        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 @@
                                                
                                        
                                        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;
                                        

Modified: branches/dmsnell/heap-buddy/analyzer/Util.cs
===================================================================
--- branches/dmsnell/heap-buddy/analyzer/Util.cs        2006-08-06 23:24:01 UTC 
(rev 63419)
+++ branches/dmsnell/heap-buddy/analyzer/Util.cs        2006-08-07 02:15:22 UTC 
(rev 63420)
@@ -65,7 +65,10 @@
                        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)

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to