-
Notifications
You must be signed in to change notification settings - Fork 21
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
24 changed files
with
318 additions
and
210 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
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
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,18 +1,21 @@ | ||
from ....commons.ocm import getData | ||
from datetime import date | ||
|
||
import pandas as pd | ||
|
||
################################################################ | ||
# This will return a DataFrame from OCM required by the CPT endpoint | ||
################################################################ | ||
async def ocmMapper(start_datetime: date, end_datetime: date): | ||
df = await getData(start_datetime, end_datetime, f'ocm.elasticsearch') | ||
if len(df) == 0: | ||
return df | ||
df.insert(len(df.columns), "product", "ocm") | ||
df.insert(len(df.columns), "releaseStream", "Nightly") | ||
df["testName"] = df["attack"] | ||
df["startDate"] = df["metrics.earliest"] | ||
df["endDate"] = df["metrics.end"] | ||
async def ocmMapper(start_datetime: date, end_datetime: date, size:int, offset:int): | ||
response = await getData(start_datetime, end_datetime, size, offset, f'ocm.elasticsearch') | ||
if not isinstance(response, pd.DataFrame) and response: | ||
df = response["data"] | ||
if len(df) == 0: | ||
return df | ||
df.insert(len(df.columns), "product", "ocm") | ||
df.insert(len(df.columns), "releaseStream", "Nightly") | ||
df["testName"] = df["attack"] | ||
df["startDate"] = df["metrics.earliest"] | ||
df["endDate"] = df["metrics.end"] | ||
|
||
return df | ||
return {"data":df, "total": response["total"]} | ||
return {"data":pd.DataFrame(), "total":0} |
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,17 +1,21 @@ | ||
from ....commons.ocp import getData | ||
from ....commons.utils import getReleaseStream | ||
from datetime import date | ||
|
||
import pandas as pd | ||
|
||
################################################################ | ||
# This will return a DataFrame from OCP required by the CPT endpoint | ||
################################################################ | ||
async def ocpMapper(start_datetime: date, end_datetime: date): | ||
df = await getData(start_datetime, end_datetime, f'ocp.elasticsearch') | ||
if len(df) == 0: | ||
return df | ||
df.insert(len(df.columns), "product", "ocp") | ||
df["releaseStream"] = df.apply(getReleaseStream, axis=1) | ||
df["version"] = df["shortVersion"] | ||
df["testName"] = df["benchmark"] | ||
return df | ||
async def ocpMapper(start_datetime: date, end_datetime: date, size:int, offset:int): | ||
response = await getData(start_datetime, end_datetime, size, offset, f'ocp.elasticsearch') | ||
if not isinstance(response, pd.DataFrame) and response: | ||
df = response["data"] | ||
if len(df) == 0: | ||
return df | ||
df.insert(len(df.columns), "product", "ocp") | ||
df["releaseStream"] = df.apply(getReleaseStream, axis=1) | ||
df["version"] = df["shortVersion"] | ||
df["testName"] = df["benchmark"] | ||
return {"data":df, "total": response["total"]} | ||
return {"data":pd.DataFrame(), "total": response["total"]} | ||
|
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,15 +1,18 @@ | ||
from ....commons.quay import getData | ||
from datetime import date | ||
import pandas as pd | ||
|
||
|
||
##################################################################### | ||
# This will return a DataFrame from Quay required by the CPT endpoint | ||
##################################################################### | ||
async def quayMapper(start_datetime: date, end_datetime: date): | ||
df = await getData(start_datetime, end_datetime, f'quay.elasticsearch') | ||
if len(df) == 0: | ||
return df | ||
df.insert(len(df.columns), "product", "quay") | ||
df["version"] = df["releaseStream"] | ||
df["testName"] = df["benchmark"] | ||
return df | ||
##################################################################################### | ||
# This will return a DataFrame from Quay required by the CPT endpoint with Total jobs | ||
##################################################################################### | ||
async def quayMapper(start_datetime: date, end_datetime: date, size:int, offset: int): | ||
response = await getData(start_datetime, end_datetime, size, offset, f'quay.elasticsearch') | ||
if not isinstance(response, pd.DataFrame) and response: | ||
df = response["data"] | ||
if len(df) == 0: | ||
return df | ||
df.insert(len(df.columns), "product", "quay") | ||
df["version"] = df["releaseStream"] | ||
df["testName"] = df["benchmark"] | ||
return {"data":df, "total": response["total"]} | ||
return {"data":pd.DataFrame(), "total":0} |
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,17 +1,20 @@ | ||
from ....commons.telco import getData | ||
from ....commons.utils import getReleaseStream | ||
from datetime import date | ||
|
||
import pandas as pd | ||
|
||
##################################################################### | ||
# This will return a DataFrame from Telco required by the CPT endpoint | ||
##################################################################### | ||
async def telcoMapper(start_datetime: date, end_datetime: date): | ||
df = await getData(start_datetime, end_datetime, f'telco.splunk') | ||
if len(df) == 0: | ||
return df | ||
df.insert(len(df.columns), "product", "telco") | ||
df["releaseStream"] = df.apply(getReleaseStream, axis=1) | ||
df["version"] = df["shortVersion"] | ||
df["testName"] = df["benchmark"] | ||
return df | ||
async def telcoMapper(start_datetime: date, end_datetime: date, size:int, offset: int): | ||
response = await getData(start_datetime, end_datetime, size, offset, f'telco.splunk') | ||
if not isinstance(response, pd.DataFrame) and response: | ||
df = response["data"] | ||
if len(df) == 0: | ||
return df | ||
df.insert(len(df.columns), "product", "telco") | ||
df["releaseStream"] = df.apply(getReleaseStream, axis=1) | ||
df["version"] = df["shortVersion"] | ||
df["testName"] = df["benchmark"] | ||
return {"data":df, "total": response["total"]} | ||
return {"data":pd.DataFrame(), "total":0} |
Oops, something went wrong.