Commit 563e4e6a authored by caminha's avatar caminha
Browse files

more fixes to simple plots

parent cdd8ea79
......@@ -114,7 +114,7 @@ node_type_order = ("Consumer", "Border Router", # "Consumer Router",
scenarioOrder = ("Transformation overlay", "Conventional NDN subscriptions")
nodeOrder = "C1", "C2", "DR1", "DR2/DR3", "Producer"
# subIntervalOrder = "Same", 'Compatible', 'Incompatible'
subIntervalOrder = "Equal", "Subset", "Superset"
# subIntervalOrder = "Equal", "Subset", "Superset"
# nodeTypeOrder = ['Router', 'DRL0', 'DRL1', 'DRL2', 'Producer']
if params.single_pdf:
......@@ -131,19 +131,20 @@ logger.info("Plotting content store graphs...")
fullCsDF.loc[fullCsDF.Node.isin(['DR2', 'DR3']), "Node"] = "DR2/DR3"
fullCsDF.loc[fullCsDF.NodeType == "Producer", "Node"] = "Producer"
mask = (fullCsDF.Type.str.contains("CacheSizeByte")) # & \
mask = (fullCsDF.Type.str.contains("CacheSizeByte")) & \
(fullCsDF.SecondSubInterval.str.contains('Subset'))
# (~fullCsDF.NodeType.str.contains("Consumer"))
maskedData = fullCsDF.loc[mask, ['Node', 'SecondSubInterval', 'Packets', 'appScenario', 'seed']]
maskedData.rename(columns={'SecondSubInterval': 'Second Dataset', 'appScenario': 'Application Scenario'}, inplace=True)
trio_catplot(title="Volume of Data in Content Store v1", ylabel='Content Store Size (KB)', xlabel='Node or Type of Node',
single_pdf=pdf, kind=params.catType, x='Node', order=nodeOrder, y='Packets', hue='Application Scenario',
hue_order=scenarioOrder, row='Second Dataset', row_order=subIntervalOrder, data=maskedData)
single_catplot(title="Volume of Data in Content Store v1", ylabel='Content Store Size (KB)', xlabel='Node or Type of Node',
single_pdf=pdf, kind=params.catType, x='Node', order=nodeOrder, y='Packets', hue='Application Scenario',
hue_order=scenarioOrder, data=maskedData)#, row='Second Dataset', row_order=subIntervalOrder)
trio_relplot(title="Volume of Data in Content Store v1", ylabel='Content Store Size (KB)', xlabel='Node or Type of Node',
single_pdf=pdf, kind='line', x='Node', y='Packets', hue='Application Scenario', style='Application Scenario',
hue_order=scenarioOrder, row='Second Dataset', row_order=subIntervalOrder, data=maskedData)
single_relplot(title="Volume of Data in Content Store v1", ylabel='Content Store Size (KB)', xlabel='Node or Type of Node',
single_pdf=pdf, kind='line', x='Node', y='Packets', hue='Application Scenario', style='Application Scenario',
hue_order=scenarioOrder, data=maskedData)#, row='Second Dataset', row_order=subIntervalOrder)
# duo_catplot(title="Volume of Data in Content Store v2", ylabel='Content Store Size (KB)', xlabel='Node or Type of Node',
# single_pdf=pdf, kind=params.catType, x='Node', order=nodeOrder, y='Packets', row='appScenario',
......@@ -167,7 +168,9 @@ logger.info("Plotting L3 graphs...")
mask = (fullL3DF.Type == "OutData") & (fullL3DF.FaceDescr.str.startswith("netdev")) & \
(fullL3DF.KilobytesRaw != 0) & \
(~fullL3DF.NodeType.str.contains("Consumer"))
(~fullL3DF.NodeType.str.contains("Consumer")) & \
(fullL3DF.SecondSubInterval.str.contains('Subset'))
maskedData = fullL3DF.loc[mask, ["appScenario", 'SecondSubInterval', "Node", "NodeType", "seed", "KilobytesRaw"]]
### This is required because of multiple transmissions realized by the router
......@@ -176,13 +179,13 @@ aggData.loc[aggData.NodeType == "Producer", "Node"] = "Producer"
aggData.loc[aggData.Node.isin(["DR2", "DR3"]), "Node"] = "DR2/DR3"
aggData.rename(columns={'SecondSubInterval': 'Second Dataset', 'appScenario': 'Application Scenario'}, inplace=True)
trio_catplot(title="Data Transmissions v1", ylabel='Transmitted data (KB)', xlabel='Node or Type of Node',
single_pdf=pdf, kind=params.catType, x='Node', order=nodeOrder[2:], y='KilobytesRaw', data=aggData,
hue='Application Scenario', hue_order=scenarioOrder, row='Second Dataset', row_order=subIntervalOrder)
single_catplot(title="Data Transmissions v1", ylabel='Transmitted data (KB)', xlabel='Node or Type of Node',
single_pdf=pdf, kind=params.catType, x='Node', order=nodeOrder[2:], y='KilobytesRaw', data=aggData,
hue='Application Scenario', hue_order=scenarioOrder)#, row='Second Dataset', row_order=subIntervalOrder)
trio_relplot(title="Data Transmissions v1", ylabel='Transmitted data (KB)', xlabel='Node or Type of Node',
single_pdf=pdf, kind='line', x='Node', y='KilobytesRaw', hue='Application Scenario', data=aggData,
style='Application Scenario', hue_order=scenarioOrder, row='Second Dataset', row_order=subIntervalOrder)
single_relplot(title="Data Transmissions v1", ylabel='Transmitted data (KB)', xlabel='Node or Type of Node',
single_pdf=pdf, kind='line', x='Node', y='KilobytesRaw', hue='Application Scenario', data=aggData,
style='Application Scenario', hue_order=scenarioOrder)#, row='Second Dataset', row_order=subIntervalOrder)
# duo_catplot(title="Data Transmissions v2", ylabel='Transmitted data (KB)', xlabel='Node or Type of Node',
# single_pdf=pdf, kind=params.catType, x='Node', order=nodeOrder[2:], y='KilobytesRaw', row='appScenario',
......@@ -198,22 +201,26 @@ logger.info("Plotting consumer metrics...")
fullConsumerStatsDF.loc[fullConsumerStatsDF.Node.str.contains('C1'), 'Node'] = 'First Consumer'
fullConsumerStatsDF.loc[fullConsumerStatsDF.Node.str.contains('C2'), 'Node'] = 'Second Consumer'
mask = (fullConsumerStatsDF.Metric.str.contains("InterestSatisfaction"))
mask = (fullConsumerStatsDF.Metric.str.contains("InterestSatisfaction")) & \
(fullConsumerStatsDF.SecondSubInterval.str.contains("Subset"))
maskedData = fullConsumerStatsDF.loc[mask, ['Node', 'SecondSubInterval', 'Value', 'appScenario', 'seed']]
maskedData.rename(columns={'SecondSubInterval': 'Second Dataset', 'appScenario': 'Application Scenario'}, inplace=True)
duo_catplot(title="Interest Satisfaction", ylabel='Satisfaction (%)', xlabel='Dataset requested by C2 compared to dataset requested by C1',
single_pdf=pdf, sharey=True, x='Second Dataset', kind=params.catType, y='Value', row='Application Scenario',
row_order=scenarioOrder, data=maskedData, hue="Node", order=subIntervalOrder)
single_catplot(title="Interest Satisfaction", ylabel='Interest Satisfaction (%)', data=maskedData, single_pdf=pdf,
xlabel='', x='Node', sharey=True, kind=params.catType, y='Value', hue='Application Scenario',
hue_order=scenarioOrder)
#, hue="Node", order=subIntervalOrder)
mask = (fullConsumerStatsDF.Metric.str.contains("FirstDataDelayNorm")) & \
(fullConsumerStatsDF.SecondSubInterval.str.contains("Subset"))
mask = (fullConsumerStatsDF.Metric.str.contains("FirstDataDelayNorm")) # & \
# (fullConsumerStatsDF.appScenario.str.contains("Transformation overlay"))
maskedData = fullConsumerStatsDF.loc[mask, ['appScenario', 'SecondSubInterval', 'Node', 'Value', 'seed']]
maskedData.rename(columns={'SecondSubInterval': 'Second Dataset', 'appScenario': 'Application Scenario'}, inplace=True)
duo_catplot(title="Normalized First Data Delay", ylabel='Normalized Delay', y='Value', x='Second Dataset',
xlabel='Dataset requested by C2 compared to dataset requested by C1', single_pdf=pdf, kind=params.catType,
row='Application Scenario', row_order=scenarioOrder, data=maskedData, hue="Node", order=subIntervalOrder)
single_catplot(title="Normalized First Data Delay", ylabel='Normalized Delay', y='Value', x="Node", xlabel='',
single_pdf=pdf, kind=params.catType, hue='Application Scenario', hue_order=scenarioOrder,
data=maskedData)
logger.info("Plotting stream hits...")
......@@ -224,7 +231,8 @@ maskedData = fullStreamHitsDF.loc[mask, ['Node', 'SecondSubInterval', 'HitCount'
maskedData.rename(columns={'SecondSubInterval': 'Second Dataset', 'appScenario': 'Application Scenario'}, inplace=True)
single_catplot(title="First Domain Router Stream Hits", ylabel='Number of streams reused', single_pdf=pdf, y='HitCount',
xlabel='Dataset requested by C2 compared to dataset requested by C1', kind=params.catType, x='Second Dataset', data=maskedData)
xlabel='Dataset requested by C2 compared to dataset requested by C1', kind=params.catType,
x='Second Dataset', data=maskedData)
# logger.info("Plotting stream delays...")
#
......
......@@ -178,7 +178,7 @@ def single_relplot(xlabel, ylabel, title=None, single_pdf=None, **plot_params):
return graph
def single_catplot(xlabel:str, ylabel:str, title:str=None, single_pdf=None, **plot_params):
def single_catplot(xlabel, ylabel, title=None, single_pdf=None, **plot_params):
unified_params = {**wideSizingParams, **plot_params}
graph = sb.catplot(**unified_params)
graph.set_xlabels(xlabel)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment