-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
703 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,52 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import os | ||
import glob | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
|
||
def plot_kafka_output(directory, kind): | ||
numMsg = "" | ||
for TYPE in ["baseline", "interceptor"]: | ||
X = np.empty(0, dtype=float) | ||
Y = np.empty(0, dtype=float) | ||
print(TYPE) | ||
for filename in sorted(glob.iglob(f"{directory}/{kind}-{TYPE}*.txt")): | ||
size = filename.split('-')[-1].split('.')[0] | ||
numMsg = filename.split('-')[-2] | ||
plt.title(f"{kind} perf {numMsg} msgs") | ||
plt.xlabel("Message Size [byte]") | ||
X = np.append(X, size) | ||
print(filename) | ||
with open(filename, 'r') as f: | ||
lines = f.read().splitlines() | ||
last_line = lines[-1] | ||
throughput = "0" | ||
if kind == "producer": | ||
throughput = last_line.split(',')[1].split(' ')[1] | ||
plt.ylabel("records/sec") | ||
else: | ||
throughput = last_line.split(',')[3] | ||
plt.ylabel("MB/sec") | ||
Y = np.append(Y, round(float(throughput), 2)) | ||
print(X) | ||
print(Y) | ||
plt.scatter(X, Y, label=f"{TYPE}") | ||
|
||
plt.legend() | ||
plt.savefig(f"{directory}/{kind}-{numMsg}.png") | ||
plt.clf() | ||
numMsg = "" | ||
for TYPE in ["baseline", "interceptor"]: | ||
X = np.empty(0, dtype=float) | ||
Y = np.empty(0, dtype=float) | ||
print(TYPE) | ||
#grab last 4 characters of the file name: | ||
def message_size(x): | ||
print(x) | ||
print(x.split("-")[-1].rsplit( ".", 1 )[ 0 ]) | ||
return(int(x.split("-")[-1].rsplit( ".", 1 )[ 0 ])) | ||
file_list = glob.iglob(f"{directory}/{kind}-{TYPE}*.txt") | ||
for filename in sorted(file_list, key = message_size): | ||
size = filename.split('-')[-1].split('.')[0] | ||
numMsg = filename.split('-')[-2] | ||
plt.title(f"{kind} perf {numMsg} msgs") | ||
plt.xlabel("Message Size [byte]") | ||
X = np.append(X, size) | ||
print(filename) | ||
with open(filename, 'r') as f: | ||
lines = f.read().splitlines() | ||
last_line = lines[-1] | ||
throughput = "0" | ||
if kind == "producer": | ||
throughput = last_line.split(',')[1].split(' ')[1] | ||
plt.ylabel("records/sec") | ||
else: | ||
throughput = last_line.split(',')[3] | ||
plt.ylabel("MB/sec") | ||
Y = np.append(Y, round(float(throughput), 2)) | ||
print(X) | ||
print(Y) | ||
plt.scatter(X, Y, label=f"{TYPE}") | ||
|
||
plt.legend() | ||
plt.savefig(f"{directory}/{kind}-{numMsg}.png") | ||
plt.clf() | ||
|
||
|
||
def main(): | ||
plot_kafka_output("results", "producer") | ||
plot_kafka_output("results", "consumer") | ||
plot_kafka_output("results", "producer") | ||
plot_kafka_output("results", "consumer") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" comparisonMethod="maven" xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd"> | ||
<ignoreVersions> | ||
<!-- Ignore Alpha's, Beta's, release candidates and milestones --> | ||
<ignoreVersion type="regex">(?i).*Alpha(?:-?\d+)?</ignoreVersion> | ||
<ignoreVersion type="regex">(?i).*a(?:-?\d+)?</ignoreVersion> | ||
<ignoreVersion type="regex">(?i).*Beta(?:-?\d+)?</ignoreVersion> | ||
<ignoreVersion type="regex">(?i).*-B(?:-?\d+)?</ignoreVersion> | ||
<ignoreVersion type="regex">(?i).*RC(?:-?\d+)?</ignoreVersion> | ||
<ignoreVersion type="regex">(?i).*CR(?:-?\d+)?</ignoreVersion> | ||
<ignoreVersion type="regex">(?i).*M(?:-?\d+)?</ignoreVersion> | ||
</ignoreVersions> | ||
<rules> | ||
</rules> | ||
</ruleset> |
Oops, something went wrong.