mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-06-04 07:23:53 +00:00
Compare commits
5 Commits
33.0-dev20
...
33.0-dev25
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
486d0b1088 | ||
|
|
f61a02d288 | ||
|
|
03694e57c0 | ||
|
|
1760afda2b | ||
|
|
522e2cc3da |
@@ -58,7 +58,7 @@ export function rightOnHoverCheck(path, expectedText) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function checkFilterByMethod(funcDict) {
|
export function checkFilterByMethod(funcDict) {
|
||||||
const {protocol, method, methodQuery, summary, summaryQuery} = funcDict;
|
const {protocol, method, methodQuery, summary, summaryQuery, numberOfRecords} = funcDict;
|
||||||
const summaryDict = getSummaryDict(summary, summaryQuery);
|
const summaryDict = getSummaryDict(summary, summaryQuery);
|
||||||
const methodDict = getMethodDict(method, methodQuery);
|
const methodDict = getMethodDict(method, methodQuery);
|
||||||
const protocolDict = getProtocolDict(protocol.name, protocol.text);
|
const protocolDict = getProtocolDict(protocol.name, protocol.text);
|
||||||
@@ -69,47 +69,53 @@ export function checkFilterByMethod(funcDict) {
|
|||||||
cy.get('[type="submit"]').click();
|
cy.get('[type="submit"]').click();
|
||||||
cy.get('.w-tc-editor').should('have.attr', 'style').and('include', Cypress.env('greenFilterColor'));
|
cy.get('.w-tc-editor').should('have.attr', 'style').and('include', Cypress.env('greenFilterColor'));
|
||||||
|
|
||||||
cy.get('#entries-length').should('not.have.text', '0').then(() => {
|
waitForFetch(numberOfRecords);
|
||||||
cy.get(`#list [id]`).then(elements => {
|
pauseStream();
|
||||||
const listElmWithIdAttr = Object.values(elements);
|
|
||||||
let doneCheckOnFirst = false;
|
|
||||||
|
|
||||||
cy.get('#entries-length').invoke('text').then(len => {
|
cy.get(`#list [id^=entry]`).then(elements => {
|
||||||
resizeIfNeeded(len);
|
const listElmWithIdAttr = Object.values(elements);
|
||||||
listElmWithIdAttr.forEach(entry => {
|
let doneCheckOnFirst = false;
|
||||||
if (entry?.id && entry.id.match(RegExp(/entry-(\d{24})$/gm))) {
|
|
||||||
const entryId = getEntryId(entry.id);
|
|
||||||
|
|
||||||
leftTextCheck(entryId, methodDict.pathLeft, methodDict.expectedText);
|
cy.get('#entries-length').invoke('text').then(len => {
|
||||||
leftTextCheck(entryId, protocolDict.pathLeft, protocolDict.expectedTextLeft);
|
listElmWithIdAttr.forEach(entry => {
|
||||||
if (summaryDict)
|
if (entry?.id && entry.id.match(RegExp(/entry-(\d{24})$/gm))) {
|
||||||
leftTextCheck(entryId, summaryDict.pathLeft, summaryDict.expectedText);
|
const entryId = getEntryId(entry.id);
|
||||||
|
|
||||||
if (!doneCheckOnFirst) {
|
leftTextCheck(entryId, methodDict.pathLeft, methodDict.expectedText);
|
||||||
deepCheck(funcDict, protocolDict, methodDict, entry);
|
leftTextCheck(entryId, protocolDict.pathLeft, protocolDict.expectedTextLeft);
|
||||||
doneCheckOnFirst = true;
|
if (summaryDict)
|
||||||
}
|
leftTextCheck(entryId, summaryDict.pathLeft, summaryDict.expectedText);
|
||||||
}
|
|
||||||
});
|
if (!doneCheckOnFirst) {
|
||||||
resizeIfNeeded(len);
|
deepCheck(funcDict, protocolDict, methodDict, entry);
|
||||||
});
|
doneCheckOnFirst = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const refreshWaitTimeout = 10000;
|
||||||
|
|
||||||
|
export function waitForFetch(gt) {
|
||||||
|
cy.get('#entries-length', {timeout: refreshWaitTimeout}).should((el) => {
|
||||||
|
expect(parseInt(el.text().trim(), 10)).to.be.greaterThan(gt);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function pauseStream() {
|
||||||
|
cy.get('#pause-icon').click();
|
||||||
|
cy.get('#pause-icon').should('not.be.visible');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export function getEntryId(id) {
|
export function getEntryId(id) {
|
||||||
// take the second part from the string (entry-<ID>)
|
// take the second part from the string (entry-<ID>)
|
||||||
return id.split('-')[1];
|
return id.split('-')[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function resizeIfNeeded(entriesLen) {
|
|
||||||
if (entriesLen > maxEntriesInDom){
|
|
||||||
Cypress.config().viewportHeight === Cypress.env('normalMizuHeight') ?
|
|
||||||
resizeToHugeMizu() : resizeToNormalMizu()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function deepCheck(generalDict, protocolDict, methodDict, entry) {
|
function deepCheck(generalDict, protocolDict, methodDict, entry) {
|
||||||
const entryId = getEntryId(entry.id);
|
const entryId = getEntryId(entry.id);
|
||||||
const {summary, value} = generalDict;
|
const {summary, value} = generalDict;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ it('opening mizu', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const rabbitProtocolDetails = {name: 'AMQP', text: 'Advanced Message Queuing Protocol 0-9-1'};
|
const rabbitProtocolDetails = {name: 'AMQP', text: 'Advanced Message Queuing Protocol 0-9-1'};
|
||||||
|
const numberOfRecords = 5;
|
||||||
|
|
||||||
checkFilterByMethod({
|
checkFilterByMethod({
|
||||||
protocol: rabbitProtocolDetails,
|
protocol: rabbitProtocolDetails,
|
||||||
@@ -12,6 +13,7 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.method == "exchange declare"',
|
methodQuery: 'request.method == "exchange declare"',
|
||||||
summary: 'exchange',
|
summary: 'exchange',
|
||||||
summaryQuery: 'request.exchange == "exchange"',
|
summaryQuery: 'request.exchange == "exchange"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: null
|
value: null
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -21,6 +23,7 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.method == "queue declare"',
|
methodQuery: 'request.method == "queue declare"',
|
||||||
summary: 'queue',
|
summary: 'queue',
|
||||||
summaryQuery: 'request.queue == "queue"',
|
summaryQuery: 'request.queue == "queue"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: null
|
value: null
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -30,6 +33,7 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.method == "queue bind"',
|
methodQuery: 'request.method == "queue bind"',
|
||||||
summary: 'queue',
|
summary: 'queue',
|
||||||
summaryQuery: 'request.queue == "queue"',
|
summaryQuery: 'request.queue == "queue"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: null
|
value: null
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -39,6 +43,7 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.method == "basic publish"',
|
methodQuery: 'request.method == "basic publish"',
|
||||||
summary: 'exchange',
|
summary: 'exchange',
|
||||||
summaryQuery: 'request.exchange == "exchange"',
|
summaryQuery: 'request.exchange == "exchange"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: {tab: valueTabs.request, regex: /^message$/mg}
|
value: {tab: valueTabs.request, regex: /^message$/mg}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -48,6 +53,7 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.method == "basic consume"',
|
methodQuery: 'request.method == "basic consume"',
|
||||||
summary: 'queue',
|
summary: 'queue',
|
||||||
summaryQuery: 'request.queue == "queue"',
|
summaryQuery: 'request.queue == "queue"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: null
|
value: null
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -57,5 +63,6 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.method == "basic deliver"',
|
methodQuery: 'request.method == "basic deliver"',
|
||||||
summary: 'exchange',
|
summary: 'exchange',
|
||||||
summaryQuery: 'request.queue == "exchange"',
|
summaryQuery: 'request.queue == "exchange"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: {tab: valueTabs.request, regex: /^message$/mg}
|
value: {tab: valueTabs.request, regex: /^message$/mg}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ it('opening mizu', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const redisProtocolDetails = {name: 'redis', text: 'Redis Serialization Protocol'};
|
const redisProtocolDetails = {name: 'redis', text: 'Redis Serialization Protocol'};
|
||||||
|
const numberOfRecords = 5;
|
||||||
|
|
||||||
checkFilterByMethod({
|
checkFilterByMethod({
|
||||||
protocol: redisProtocolDetails,
|
protocol: redisProtocolDetails,
|
||||||
@@ -12,6 +13,7 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.command == "PING"',
|
methodQuery: 'request.command == "PING"',
|
||||||
summary: null,
|
summary: null,
|
||||||
summaryQuery: '',
|
summaryQuery: '',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: null
|
value: null
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -21,6 +23,7 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.command == "SET"',
|
methodQuery: 'request.command == "SET"',
|
||||||
summary: 'key',
|
summary: 'key',
|
||||||
summaryQuery: 'request.key == "key"',
|
summaryQuery: 'request.key == "key"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: {tab: valueTabs.request, regex: /^\[value, keepttl]$/mg}
|
value: {tab: valueTabs.request, regex: /^\[value, keepttl]$/mg}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -30,6 +33,7 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.command == "EXISTS"',
|
methodQuery: 'request.command == "EXISTS"',
|
||||||
summary: 'key',
|
summary: 'key',
|
||||||
summaryQuery: 'request.key == "key"',
|
summaryQuery: 'request.key == "key"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: {tab: valueTabs.response, regex: /^1$/mg}
|
value: {tab: valueTabs.response, regex: /^1$/mg}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -39,6 +43,7 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.command == "GET"',
|
methodQuery: 'request.command == "GET"',
|
||||||
summary: 'key',
|
summary: 'key',
|
||||||
summaryQuery: 'request.key == "key"',
|
summaryQuery: 'request.key == "key"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: {tab: valueTabs.response, regex: /^value$/mg}
|
value: {tab: valueTabs.response, regex: /^value$/mg}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -48,5 +53,6 @@ checkFilterByMethod({
|
|||||||
methodQuery: 'request.command == "DEL"',
|
methodQuery: 'request.command == "DEL"',
|
||||||
summary: 'key',
|
summary: 'key',
|
||||||
summaryQuery: 'request.key == "key"',
|
summaryQuery: 'request.key == "key"',
|
||||||
|
numberOfRecords: numberOfRecords,
|
||||||
value: {tab: valueTabs.response, regex: /^1$|^0$/mg}
|
value: {tab: valueTabs.response, regex: /^1$|^0$/mg}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import {
|
|||||||
resizeToNormalMizu,
|
resizeToNormalMizu,
|
||||||
rightOnHoverCheck,
|
rightOnHoverCheck,
|
||||||
rightTextCheck,
|
rightTextCheck,
|
||||||
verifyMinimumEntries
|
verifyMinimumEntries,
|
||||||
|
refreshWaitTimeout,
|
||||||
|
waitForFetch,
|
||||||
|
pauseStream
|
||||||
} from "../testHelpers/TrafficHelper";
|
} from "../testHelpers/TrafficHelper";
|
||||||
|
|
||||||
const refreshWaitTimeout = 10000;
|
|
||||||
|
|
||||||
|
|
||||||
const fullParam = Cypress.env('arrayDict'); // "Name:fooNamespace:barName:foo1Namespace:bar1"
|
const fullParam = Cypress.env('arrayDict'); // "Name:fooNamespace:barName:foo1Namespace:bar1"
|
||||||
const podsArray = fullParam.split('Name:').slice(1); // ["fooNamespace:bar", "foo1Namespace:bar1"]
|
const podsArray = fullParam.split('Name:').slice(1); // ["fooNamespace:bar", "foo1Namespace:bar1"]
|
||||||
podsArray.forEach((podStr, index) => {
|
podsArray.forEach((podStr, index) => {
|
||||||
@@ -70,7 +70,8 @@ checkFilter({
|
|||||||
leftSideExpectedText: 'HTTP',
|
leftSideExpectedText: 'HTTP',
|
||||||
rightSidePath: '[title=HTTP]',
|
rightSidePath: '[title=HTTP]',
|
||||||
rightSideExpectedText: 'Hypertext Transfer Protocol -- HTTP/1.1',
|
rightSideExpectedText: 'Hypertext Transfer Protocol -- HTTP/1.1',
|
||||||
applyByCtrlEnter: true
|
applyByCtrlEnter: true,
|
||||||
|
numberOfRecords: 20,
|
||||||
});
|
});
|
||||||
|
|
||||||
checkFilter({
|
checkFilter({
|
||||||
@@ -79,7 +80,8 @@ checkFilter({
|
|||||||
leftSideExpectedText: '200',
|
leftSideExpectedText: '200',
|
||||||
rightSidePath: '> :nth-child(2) [title="Status Code"]',
|
rightSidePath: '> :nth-child(2) [title="Status Code"]',
|
||||||
rightSideExpectedText: '200',
|
rightSideExpectedText: '200',
|
||||||
applyByCtrlEnter: false
|
applyByCtrlEnter: false,
|
||||||
|
numberOfRecords: 20
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Cypress.env('shouldCheckSrcAndDest')) {
|
if (Cypress.env('shouldCheckSrcAndDest')) {
|
||||||
@@ -91,7 +93,8 @@ if (Cypress.env('shouldCheckSrcAndDest')) {
|
|||||||
leftSideExpectedText: '[Unresolved]',
|
leftSideExpectedText: '[Unresolved]',
|
||||||
rightSidePath: '> :nth-child(2) [title="Source Name"]',
|
rightSidePath: '> :nth-child(2) [title="Source Name"]',
|
||||||
rightSideExpectedText: '[Unresolved]',
|
rightSideExpectedText: '[Unresolved]',
|
||||||
applyByCtrlEnter: false
|
applyByCtrlEnter: false,
|
||||||
|
numberOfRecords: 20
|
||||||
});
|
});
|
||||||
|
|
||||||
checkFilter({
|
checkFilter({
|
||||||
@@ -100,7 +103,8 @@ if (Cypress.env('shouldCheckSrcAndDest')) {
|
|||||||
leftSideExpectedText: 'httpbin.mizu-tests',
|
leftSideExpectedText: 'httpbin.mizu-tests',
|
||||||
rightSidePath: '> :nth-child(2) > :nth-child(2) > :nth-child(2) > :nth-child(3) > :nth-child(2)',
|
rightSidePath: '> :nth-child(2) > :nth-child(2) > :nth-child(2) > :nth-child(3) > :nth-child(2)',
|
||||||
rightSideExpectedText: 'httpbin.mizu-tests',
|
rightSideExpectedText: 'httpbin.mizu-tests',
|
||||||
applyByCtrlEnter: false
|
applyByCtrlEnter: false,
|
||||||
|
numberOfRecords: 20
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +114,8 @@ checkFilter({
|
|||||||
leftSideExpectedText: 'GET',
|
leftSideExpectedText: 'GET',
|
||||||
rightSidePath: '> :nth-child(2) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2)',
|
rightSidePath: '> :nth-child(2) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2)',
|
||||||
rightSideExpectedText: 'GET',
|
rightSideExpectedText: 'GET',
|
||||||
applyByCtrlEnter: true
|
applyByCtrlEnter: true,
|
||||||
|
numberOfRecords: 20
|
||||||
});
|
});
|
||||||
|
|
||||||
checkFilter({
|
checkFilter({
|
||||||
@@ -119,7 +124,8 @@ checkFilter({
|
|||||||
leftSideExpectedText: '/get',
|
leftSideExpectedText: '/get',
|
||||||
rightSidePath: '> :nth-child(2) > :nth-child(2) > :nth-child(1) > :nth-child(2) > :nth-child(2)',
|
rightSidePath: '> :nth-child(2) > :nth-child(2) > :nth-child(1) > :nth-child(2) > :nth-child(2)',
|
||||||
rightSideExpectedText: '/get',
|
rightSideExpectedText: '/get',
|
||||||
applyByCtrlEnter: false
|
applyByCtrlEnter: false,
|
||||||
|
numberOfRecords: 20
|
||||||
});
|
});
|
||||||
|
|
||||||
checkFilter({
|
checkFilter({
|
||||||
@@ -128,7 +134,8 @@ checkFilter({
|
|||||||
leftSideExpectedText: '127.0.0.1',
|
leftSideExpectedText: '127.0.0.1',
|
||||||
rightSidePath: '> :nth-child(2) [title="Source IP"]',
|
rightSidePath: '> :nth-child(2) [title="Source IP"]',
|
||||||
rightSideExpectedText: '127.0.0.1',
|
rightSideExpectedText: '127.0.0.1',
|
||||||
applyByCtrlEnter: false
|
applyByCtrlEnter: false,
|
||||||
|
numberOfRecords: 20
|
||||||
});
|
});
|
||||||
|
|
||||||
checkFilterNoResults('request.method == "POST"');
|
checkFilterNoResults('request.method == "POST"');
|
||||||
@@ -187,7 +194,8 @@ function checkFilter(filterDetails) {
|
|||||||
rightSidePath,
|
rightSidePath,
|
||||||
rightSideExpectedText,
|
rightSideExpectedText,
|
||||||
leftSideExpectedText,
|
leftSideExpectedText,
|
||||||
applyByCtrlEnter
|
applyByCtrlEnter,
|
||||||
|
numberOfRecords
|
||||||
} = filterDetails;
|
} = filterDetails;
|
||||||
|
|
||||||
const entriesForDeeperCheck = 5;
|
const entriesForDeeperCheck = 5;
|
||||||
@@ -200,7 +208,7 @@ function checkFilter(filterDetails) {
|
|||||||
if (!applyByCtrlEnter)
|
if (!applyByCtrlEnter)
|
||||||
cy.get('[type="submit"]').click();
|
cy.get('[type="submit"]').click();
|
||||||
|
|
||||||
waitForFetch();
|
waitForFetch(numberOfRecords);
|
||||||
pauseStream();
|
pauseStream();
|
||||||
|
|
||||||
cy.get(`#list [id^=entry]`).last().then(elem => {
|
cy.get(`#list [id^=entry]`).last().then(elem => {
|
||||||
@@ -231,22 +239,11 @@ function checkFilter(filterDetails) {
|
|||||||
// reloading then waiting for the entries number to load
|
// reloading then waiting for the entries number to load
|
||||||
resizeToNormalMizu();
|
resizeToNormalMizu();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForFetch();
|
waitForFetch(numberOfRecords);
|
||||||
pauseStream();
|
pauseStream();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function waitForFetch() {
|
|
||||||
cy.get('#entries-length', {timeout: refreshWaitTimeout}).should((el) => {
|
|
||||||
expect(parseInt(el.text().trim(), 10)).to.be.greaterThan(20);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function pauseStream() {
|
|
||||||
cy.get('#pause-icon').click();
|
|
||||||
cy.get('#pause-icon').should('not.be.visible');
|
|
||||||
}
|
|
||||||
|
|
||||||
function deeperCheck(leftSidePath, rightSidePath, filterName, rightSideExpectedText, entriesNumToCheck) {
|
function deeperCheck(leftSidePath, rightSidePath, filterName, rightSideExpectedText, entriesNumToCheck) {
|
||||||
cy.get(`#list [id^=entry]`).each((element, index) => {
|
cy.get(`#list [id^=entry]`).each((element, index) => {
|
||||||
if (index < entriesNumToCheck) {
|
if (index < entriesNumToCheck) {
|
||||||
|
|||||||
@@ -128,8 +128,8 @@ if __name__ == '__main__':
|
|||||||
matched_samples_all_files.append(matched_samples)
|
matched_samples_all_files.append(matched_samples)
|
||||||
live_samples_all_files.append(live_samples)
|
live_samples_all_files.append(live_samples)
|
||||||
processed_samples_all_files.append(processed_samples)
|
processed_samples_all_files.append(processed_samples)
|
||||||
heap_samples_all_files.append(processed_samples)
|
heap_samples_all_files.append(heap_samples)
|
||||||
goroutines_samples_all_files.append(processed_samples)
|
goroutines_samples_all_files.append(goroutines_samples)
|
||||||
|
|
||||||
cpu_samples_df = pd.concat(cpu_samples_all_files, axis=1)
|
cpu_samples_df = pd.concat(cpu_samples_all_files, axis=1)
|
||||||
rss_samples_df = pd.concat(rss_samples_all_files, axis=1)
|
rss_samples_df = pd.concat(rss_samples_all_files, axis=1)
|
||||||
@@ -137,7 +137,6 @@ if __name__ == '__main__':
|
|||||||
matched_samples_df = pd.concat(matched_samples_all_files, axis=1)
|
matched_samples_df = pd.concat(matched_samples_all_files, axis=1)
|
||||||
live_samples_df = pd.concat(live_samples_all_files, axis=1)
|
live_samples_df = pd.concat(live_samples_all_files, axis=1)
|
||||||
processed_samples_df = pd.concat(processed_samples_all_files, axis=1)
|
processed_samples_df = pd.concat(processed_samples_all_files, axis=1)
|
||||||
|
|
||||||
heap_samples_df = pd.concat(heap_samples_all_files, axis=1)
|
heap_samples_df = pd.concat(heap_samples_all_files, axis=1)
|
||||||
goroutines_samples_df = pd.concat(goroutines_samples_all_files, axis=1)
|
goroutines_samples_df = pd.concat(goroutines_samples_all_files, axis=1)
|
||||||
|
|
||||||
@@ -172,7 +171,7 @@ if __name__ == '__main__':
|
|||||||
heap_plot.legend().remove()
|
heap_plot.legend().remove()
|
||||||
|
|
||||||
goroutines_plot = plt.subplot(8, 2, 8)
|
goroutines_plot = plt.subplot(8, 2, 8)
|
||||||
plot(goroutines_plot, (goroutines_samples_df / 1024 / 1024), 'goroutines', '', 'goroutines', group_pattern)
|
plot(goroutines_plot, goroutines_samples_df, 'goroutines', '', 'goroutines', group_pattern)
|
||||||
goroutines_plot.legend().remove()
|
goroutines_plot.legend().remove()
|
||||||
|
|
||||||
fig = plt.gcf()
|
fig = plt.gcf()
|
||||||
|
|||||||
@@ -22,7 +22,14 @@ function run_single_bench() {
|
|||||||
for ((i=0;i<"$MIZU_BENCHMARK_RUN_COUNT";i++)); do
|
for ((i=0;i<"$MIZU_BENCHMARK_RUN_COUNT";i++)); do
|
||||||
log " $i: Running tapper"
|
log " $i: Running tapper"
|
||||||
rm -f tapper.log
|
rm -f tapper.log
|
||||||
nohup ./agent/build/mizuagent --tap --api-server-address ws://localhost:8899/wsTapper -i lo -stats 10 > tapper.log 2>&1 &
|
tapper_args=("--tap" "--api-server-address" "ws://localhost:8899/wsTapper" "-stats" "10")
|
||||||
|
if [[ $(uname) == "Darwin" ]]
|
||||||
|
then
|
||||||
|
tapper_args+=("-i" "lo0" "-"decoder "Loopback")
|
||||||
|
else
|
||||||
|
tapper_args+=("-i" "lo")
|
||||||
|
fi
|
||||||
|
nohup ./agent/build/mizuagent ${tapper_args[@]} > tapper.log 2>&1 &
|
||||||
|
|
||||||
log " $i: Running client (hey)"
|
log " $i: Running client (hey)"
|
||||||
hey -z $MIZU_BENCHMARK_CLIENT_PERIOD -c $MIZU_BENCHMARK_CLIENTS_COUNT -q $MIZU_BENCHMARK_QPS $MIZU_BENCHMARK_URL > /dev/null || return 1
|
hey -z $MIZU_BENCHMARK_CLIENT_PERIOD -c $MIZU_BENCHMARK_CLIENTS_COUNT -q $MIZU_BENCHMARK_QPS $MIZU_BENCHMARK_URL > /dev/null || return 1
|
||||||
|
|||||||
@@ -392,6 +392,16 @@ func (provider *Provider) GetMizuApiServerPodObject(opts *ApiServerOptions, moun
|
|||||||
Volumes: volumes,
|
Volumes: volumes,
|
||||||
DNSPolicy: core.DNSClusterFirstWithHostNet,
|
DNSPolicy: core.DNSClusterFirstWithHostNet,
|
||||||
TerminationGracePeriodSeconds: new(int64),
|
TerminationGracePeriodSeconds: new(int64),
|
||||||
|
Tolerations: []core.Toleration{
|
||||||
|
{
|
||||||
|
Operator: core.TolerationOpExists,
|
||||||
|
Effect: core.TaintEffectNoExecute,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Operator: core.TolerationOpExists,
|
||||||
|
Effect: core.TaintEffectNoSchedule,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -431,7 +431,6 @@ type TcpReader interface {
|
|||||||
type TcpStream interface {
|
type TcpStream interface {
|
||||||
SetProtocol(protocol *Protocol)
|
SetProtocol(protocol *Protocol)
|
||||||
GetOrigin() Capture
|
GetOrigin() Capture
|
||||||
GetProtocol() *Protocol
|
|
||||||
GetReqResMatchers() []RequestResponseMatcher
|
GetReqResMatchers() []RequestResponseMatcher
|
||||||
GetIsTapTarget() bool
|
GetIsTapTarget() bool
|
||||||
GetIsClosed() bool
|
GetIsClosed() bool
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package amqp
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
@@ -75,10 +74,6 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
var lastMethodFrameMessage Message
|
var lastMethodFrameMessage Message
|
||||||
|
|
||||||
for {
|
for {
|
||||||
if reader.GetParent().GetProtocol() != nil && reader.GetParent().GetProtocol() != &protocol {
|
|
||||||
return errors.New("Identified by another protocol")
|
|
||||||
}
|
|
||||||
|
|
||||||
frame, err := r.ReadFrame()
|
frame, err := r.ReadFrame()
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
// We must read until we see an EOF... very important!
|
// We must read until we see an EOF... very important!
|
||||||
@@ -90,6 +85,8 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
// drop
|
// drop
|
||||||
|
|
||||||
case *HeaderFrame:
|
case *HeaderFrame:
|
||||||
|
reader.GetParent().SetProtocol(&protocol)
|
||||||
|
|
||||||
// start content state
|
// start content state
|
||||||
header = f
|
header = f
|
||||||
remaining = int(header.Size)
|
remaining = int(header.Size)
|
||||||
@@ -107,20 +104,22 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
}
|
}
|
||||||
|
|
||||||
case *BodyFrame:
|
case *BodyFrame:
|
||||||
|
reader.GetParent().SetProtocol(&protocol)
|
||||||
|
|
||||||
// continue until terminated
|
// continue until terminated
|
||||||
remaining -= len(f.Body)
|
remaining -= len(f.Body)
|
||||||
switch lastMethodFrameMessage.(type) {
|
switch lastMethodFrameMessage.(type) {
|
||||||
case *BasicPublish:
|
case *BasicPublish:
|
||||||
eventBasicPublish.Body = f.Body
|
eventBasicPublish.Body = f.Body
|
||||||
reader.GetParent().SetProtocol(&protocol)
|
|
||||||
emitAMQP(*eventBasicPublish, amqpRequest, basicMethodMap[40], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
emitAMQP(*eventBasicPublish, amqpRequest, basicMethodMap[40], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
||||||
case *BasicDeliver:
|
case *BasicDeliver:
|
||||||
eventBasicDeliver.Body = f.Body
|
eventBasicDeliver.Body = f.Body
|
||||||
reader.GetParent().SetProtocol(&protocol)
|
|
||||||
emitAMQP(*eventBasicDeliver, amqpRequest, basicMethodMap[60], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
emitAMQP(*eventBasicDeliver, amqpRequest, basicMethodMap[60], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
||||||
}
|
}
|
||||||
|
|
||||||
case *MethodFrame:
|
case *MethodFrame:
|
||||||
|
reader.GetParent().SetProtocol(&protocol)
|
||||||
|
|
||||||
lastMethodFrameMessage = f.Method
|
lastMethodFrameMessage = f.Method
|
||||||
switch m := f.Method.(type) {
|
switch m := f.Method.(type) {
|
||||||
case *BasicPublish:
|
case *BasicPublish:
|
||||||
@@ -137,7 +136,6 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
NoWait: m.NoWait,
|
NoWait: m.NoWait,
|
||||||
Arguments: m.Arguments,
|
Arguments: m.Arguments,
|
||||||
}
|
}
|
||||||
reader.GetParent().SetProtocol(&protocol)
|
|
||||||
emitAMQP(*eventQueueBind, amqpRequest, queueMethodMap[20], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
emitAMQP(*eventQueueBind, amqpRequest, queueMethodMap[20], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
||||||
|
|
||||||
case *BasicConsume:
|
case *BasicConsume:
|
||||||
@@ -150,7 +148,6 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
NoWait: m.NoWait,
|
NoWait: m.NoWait,
|
||||||
Arguments: m.Arguments,
|
Arguments: m.Arguments,
|
||||||
}
|
}
|
||||||
reader.GetParent().SetProtocol(&protocol)
|
|
||||||
emitAMQP(*eventBasicConsume, amqpRequest, basicMethodMap[20], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
emitAMQP(*eventBasicConsume, amqpRequest, basicMethodMap[20], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
||||||
|
|
||||||
case *BasicDeliver:
|
case *BasicDeliver:
|
||||||
@@ -170,7 +167,6 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
NoWait: m.NoWait,
|
NoWait: m.NoWait,
|
||||||
Arguments: m.Arguments,
|
Arguments: m.Arguments,
|
||||||
}
|
}
|
||||||
reader.GetParent().SetProtocol(&protocol)
|
|
||||||
emitAMQP(*eventQueueDeclare, amqpRequest, queueMethodMap[10], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
emitAMQP(*eventQueueDeclare, amqpRequest, queueMethodMap[10], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
||||||
|
|
||||||
case *ExchangeDeclare:
|
case *ExchangeDeclare:
|
||||||
@@ -184,7 +180,6 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
NoWait: m.NoWait,
|
NoWait: m.NoWait,
|
||||||
Arguments: m.Arguments,
|
Arguments: m.Arguments,
|
||||||
}
|
}
|
||||||
reader.GetParent().SetProtocol(&protocol)
|
|
||||||
emitAMQP(*eventExchangeDeclare, amqpRequest, exchangeMethodMap[10], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
emitAMQP(*eventExchangeDeclare, amqpRequest, exchangeMethodMap[10], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
||||||
|
|
||||||
case *ConnectionStart:
|
case *ConnectionStart:
|
||||||
@@ -195,7 +190,6 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
Mechanisms: m.Mechanisms,
|
Mechanisms: m.Mechanisms,
|
||||||
Locales: m.Locales,
|
Locales: m.Locales,
|
||||||
}
|
}
|
||||||
reader.GetParent().SetProtocol(&protocol)
|
|
||||||
emitAMQP(*eventConnectionStart, amqpRequest, connectionMethodMap[10], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
emitAMQP(*eventConnectionStart, amqpRequest, connectionMethodMap[10], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
||||||
|
|
||||||
case *ConnectionClose:
|
case *ConnectionClose:
|
||||||
@@ -205,7 +199,6 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
ClassId: m.ClassId,
|
ClassId: m.ClassId,
|
||||||
MethodId: m.MethodId,
|
MethodId: m.MethodId,
|
||||||
}
|
}
|
||||||
reader.GetParent().SetProtocol(&protocol)
|
|
||||||
emitAMQP(*eventConnectionClose, amqpRequest, connectionMethodMap[50], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
emitAMQP(*eventConnectionClose, amqpRequest, connectionMethodMap[50], connectionInfo, reader.GetCaptureTime(), reader.GetReadProgress().Current(), reader.GetEmitter(), reader.GetParent().GetOrigin())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
type tcpStream struct {
|
type tcpStream struct {
|
||||||
isClosed bool
|
isClosed bool
|
||||||
protocol *api.Protocol
|
|
||||||
isTapTarget bool
|
isTapTarget bool
|
||||||
origin api.Capture
|
origin api.Capture
|
||||||
reqResMatchers []api.RequestResponseMatcher
|
reqResMatchers []api.RequestResponseMatcher
|
||||||
@@ -27,10 +26,6 @@ func (t *tcpStream) GetOrigin() api.Capture {
|
|||||||
return t.origin
|
return t.origin
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tcpStream) GetProtocol() *api.Protocol {
|
|
||||||
return t.protocol
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
||||||
return t.reqResMatchers
|
return t.reqResMatchers
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package http
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
@@ -144,10 +143,6 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
http2Assembler = createHTTP2Assembler(b)
|
http2Assembler = createHTTP2Assembler(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
if reader.GetParent().GetProtocol() != nil && reader.GetParent().GetProtocol() != &http11protocol {
|
|
||||||
return errors.New("Identified by another protocol")
|
|
||||||
}
|
|
||||||
|
|
||||||
if isHTTP2 {
|
if isHTTP2 {
|
||||||
err = handleHTTP2Stream(http2Assembler, reader.GetReadProgress(), reader.GetParent().GetOrigin(), reader.GetTcpID(), reader.GetCaptureTime(), reader.GetEmitter(), options, reqResMatcher)
|
err = handleHTTP2Stream(http2Assembler, reader.GetReadProgress(), reader.GetParent().GetOrigin(), reader.GetTcpID(), reader.GetCaptureTime(), reader.GetEmitter(), options, reqResMatcher)
|
||||||
if err == io.EOF || err == io.ErrUnexpectedEOF {
|
if err == io.EOF || err == io.ErrUnexpectedEOF {
|
||||||
@@ -200,10 +195,6 @@ func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if reader.GetParent().GetProtocol() == nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
type tcpStream struct {
|
type tcpStream struct {
|
||||||
isClosed bool
|
isClosed bool
|
||||||
protocol *api.Protocol
|
|
||||||
isTapTarget bool
|
isTapTarget bool
|
||||||
origin api.Capture
|
origin api.Capture
|
||||||
reqResMatchers []api.RequestResponseMatcher
|
reqResMatchers []api.RequestResponseMatcher
|
||||||
@@ -27,10 +26,6 @@ func (t *tcpStream) GetOrigin() api.Capture {
|
|||||||
return t.origin
|
return t.origin
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tcpStream) GetProtocol() *api.Protocol {
|
|
||||||
return t.protocol
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
||||||
return t.reqResMatchers
|
return t.reqResMatchers
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package kafka
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
@@ -38,10 +37,6 @@ func (d dissecting) Ping() {
|
|||||||
func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.TrafficFilteringOptions) error {
|
func (d dissecting) Dissect(b *bufio.Reader, reader api.TcpReader, options *api.TrafficFilteringOptions) error {
|
||||||
reqResMatcher := reader.GetReqResMatcher().(*requestResponseMatcher)
|
reqResMatcher := reader.GetReqResMatcher().(*requestResponseMatcher)
|
||||||
for {
|
for {
|
||||||
if reader.GetParent().GetProtocol() != nil && reader.GetParent().GetProtocol() != &_protocol {
|
|
||||||
return errors.New("Identified by another protocol")
|
|
||||||
}
|
|
||||||
|
|
||||||
if reader.GetIsClient() {
|
if reader.GetIsClient() {
|
||||||
_, _, err := ReadRequest(b, reader.GetTcpID(), reader.GetCounterPair(), reader.GetCaptureTime(), reqResMatcher)
|
_, _, err := ReadRequest(b, reader.GetTcpID(), reader.GetCounterPair(), reader.GetCaptureTime(), reqResMatcher)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
type tcpStream struct {
|
type tcpStream struct {
|
||||||
isClosed bool
|
isClosed bool
|
||||||
protocol *api.Protocol
|
|
||||||
isTapTarget bool
|
isTapTarget bool
|
||||||
origin api.Capture
|
origin api.Capture
|
||||||
reqResMatchers []api.RequestResponseMatcher
|
reqResMatchers []api.RequestResponseMatcher
|
||||||
@@ -27,10 +26,6 @@ func (t *tcpStream) GetOrigin() api.Capture {
|
|||||||
return t.origin
|
return t.origin
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tcpStream) GetProtocol() *api.Protocol {
|
|
||||||
return t.protocol
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
||||||
return t.reqResMatchers
|
return t.reqResMatchers
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
type tcpStream struct {
|
type tcpStream struct {
|
||||||
isClosed bool
|
isClosed bool
|
||||||
protocol *api.Protocol
|
|
||||||
isTapTarget bool
|
isTapTarget bool
|
||||||
origin api.Capture
|
origin api.Capture
|
||||||
reqResMatchers []api.RequestResponseMatcher
|
reqResMatchers []api.RequestResponseMatcher
|
||||||
@@ -27,10 +26,6 @@ func (t *tcpStream) GetOrigin() api.Capture {
|
|||||||
return t.origin
|
return t.origin
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tcpStream) GetProtocol() *api.Protocol {
|
|
||||||
return t.protocol
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
||||||
return t.reqResMatchers
|
return t.reqResMatchers
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,10 +83,6 @@ func (t *tcpStream) GetOrigin() api.Capture {
|
|||||||
return t.origin
|
return t.origin
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tcpStream) GetProtocol() *api.Protocol {
|
|
||||||
return t.protocol
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
func (t *tcpStream) GetReqResMatchers() []api.RequestResponseMatcher {
|
||||||
return t.reqResMatchers
|
return t.reqResMatchers
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,6 @@ func (t *tlsStream) GetOrigin() api.Capture {
|
|||||||
return api.Ebpf
|
return api.Ebpf
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tlsStream) GetProtocol() *api.Protocol {
|
|
||||||
return t.protocol
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *tlsStream) SetProtocol(protocol *api.Protocol) {
|
func (t *tlsStream) SetProtocol(protocol *api.Protocol) {
|
||||||
t.protocol = protocol
|
t.protocol = protocol
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user