@@ -120,6 +120,7 @@ def GetLevelColours(maxLevel):
120120 """ )
121121 parser .add_argument ("-i" , "--input-file" , help = "File with primary_index_portion_stats data in json per row format" , required = True )
122122 parser .add_argument ("-t" , "--type" , help = "First PK column type: Integer or Timestamp" , required = True )
123+ parser .add_argument ("-o" , "--output-file" , help = "Output file" , required = False )
123124 args = parser .parse_args ()
124125 inputFile = args .input_file
125126 pk0Type = FirstPkColumnType [args .type ]
@@ -130,7 +131,9 @@ def GetLevelColours(maxLevel):
130131 levelColors = GetLevelColours (portions .MaxCompactionLevel )
131132 rectangles = [p .ToRectangle (levelColors ) for p in portions .Portions ]
132133
133- fig , ax = plt .subplots ()
134+ dpi = 300
135+ figsize = (12000 / dpi , 9000 / dpi )
136+ fig , ax = plt .subplots (figsize = figsize , dpi = dpi )
134137 ax .set_title ("Column table portions" )
135138 ax .add_collection (PatchCollection (rectangles , match_original = True ))
136139
@@ -156,4 +159,7 @@ def GetLevelColours(maxLevel):
156159 dy = yMax - yMin
157160 ax .set_ylim (yMin - 0.05 * dy , yMax + 0.05 * dy )
158161
159- plt .show ()
162+ if args .output_file is None :
163+ plt .show ()
164+ else :
165+ plt .savefig (args .output_file , dpi = dpi )
0 commit comments