Skip to content
Snippets Groups Projects
Commit 26b830eb authored by Michael Reuscher's avatar Michael Reuscher
Browse files

new plot for Longevent in not final

parent 55af464b
No related branches found
No related tags found
1 merge request!4Python driver and data analysis part
...@@ -45,6 +45,11 @@ class DataFrameCreator: ...@@ -45,6 +45,11 @@ class DataFrameCreator:
dataframe_name = os.path.splitext(filename)[0] dataframe_name = os.path.splitext(filename)[0]
dataframe_type = dataframe_name.split('-')[1] dataframe_type = dataframe_name.split('-')[1]
dataframe = pd.read_csv(file_path, delimiter=" ", header=0) dataframe = pd.read_csv(file_path, delimiter=" ", header=0)
# Berechnung der Zeitdifferenz in Sekunden ab dem ersten Wert
if not dataframe.empty:
dataframe['start'] = pd.to_datetime(dataframe['start'], unit='s')
start_time = dataframe['start'].iloc[0]
dataframe['seconds_since_start'] = (dataframe['start'] - start_time).dt.total_seconds()
if dataframe_type in self.l_dfs: if dataframe_type in self.l_dfs:
inner_dict = self.l_dfs[dataframe_type] inner_dict = self.l_dfs[dataframe_type]
......
...@@ -53,14 +53,14 @@ class SeabornPlotter: ...@@ -53,14 +53,14 @@ class SeabornPlotter:
def plot_histogram_long(self): def plot_histogram_long(self):
df = self.dataframe df = self.dataframe
x = df['start'] x = df['seconds_since_start']
y = df['duration'] y = df['duration']
title = "Procedure: {}".format(self.name) title = "Long Procedure: {}".format(self.name)
f, ax = plt.subplots(figsize=(16, 9)) f, ax = plt.subplots(figsize=(16, 9))
sns.lineplot(x=x, y=y, hue=list(self.dataframe.index.get_level_values(0)), color="blue") sns.histplot(x=x, y=y, color="blue")
self._add_logo("desy_logo.png", logo_size=0.15, logo_x=1.065, logo_y=1.04) self._add_logo("desy_logo.png", logo_size=0.15, logo_x=1.065, logo_y=1.04)
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_xlabel("Data size [Bytes]") ax.set_xlabel("Data size [Bytes]")
ax.set_ylabel("Time/Event [s]") ax.set_ylabel("Time/Event [s]")
plt.title(title) plt.title(title)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment