(sys_metrics, rolling_window=10, figsize=(10, 8), title_fontsize=16, **kwargs)
Plots the cumulative sum of the bytes written and read by the server.

    Args:
        sys_metrics: pd.DataFrame as written by writer.py.
        rolling_window: Number of previous rounds to consider in the cumulative sum.
        figsize: Size of the plot as specified by plt.figure().
        title_fontsize: Font size for the plot's title.
        kwargs: Arguments to be passed to _set_plot_properties.
Plots the cumulative sum of the bytes written and read by the server.
Plots the cumulative sum of the bytes written and read by the server .
def plot_bytes_written_and_read(sys_metrics, rolling_window=10, figsize=(10, 8), title_fontsize=16, **kwargs):
    """Plots the cumulative sum of the bytes written and read by the server.

    Args:
        sys_metrics: pd.DataFrame as written by writer.py.
        rolling_window: Number of previous rounds to consider in the cumulative sum.
        figsize: Size of the plot as specified by plt.figure().
        title_fontsize: Font size for the plot's title.
        kwargs: Arguments to be passed to _set_plot_properties."""

    plt.figure(figsize=figsize)

    server_metrics = sys_metrics.groupby(NUM_ROUND_KEY, as_index=False).sum()
    rounds = server_metrics[NUM_ROUND_KEY]
    server_metrics = server_metrics.rolling(rolling_window, on=NUM_ROUND_KEY, min_periods=1).sum()
    plt.plot(rounds, server_metrics['bytes_written'], alpha=0.7)
    plt.plot(rounds, server_metrics['bytes_read'], alpha=0.7)

    plt.title('Bytes Written and Read by Server vs. Round Number', fontsize=title_fontsize)
    plt.xlabel('Round Number')
    plt.ylabel('Bytes')
    plt.legend(['Bytes Written', 'Bytes Read'], loc='upper left')
    _set_plot_properties(kwargs)
    plt.show()
def plot_bytes_written_and_read ( sys_metrics , rolling_window = 10 , figsize = ( 10 , 8 ) , title_fontsize = 16 , * * kwargs ) : plt . figure ( figsize = figsize ) server_metrics = sys_metrics . groupby ( NUM_ROUND_KEY , as_index = False ) . sum ( ) rounds = server_metrics [ NUM_ROUND_KEY ] server_metrics = server_metrics . rolling ( rolling_window , on = NUM_ROUND_KEY , min_periods = 1 ) . sum ( ) plt . plot ( rounds , server_metrics [ 'bytes_written' ] , alpha = 0.7 ) plt . plot ( rounds , server_metrics [ 'bytes_read' ] , alpha = 0.7 ) plt . title ( 'Bytes Written and Read by Server vs. Round Number' , fontsize = title_fontsize ) plt . xlabel ( 'Round Number' ) plt . ylabel ( 'Bytes' ) plt . legend ( [ 'Bytes Written' , 'Bytes Read' ] , loc = 'upper left' ) _set_plot_properties ( kwargs ) plt . show ( )