Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

my repeated test dosen't show in grafan #4348

Open
hamedkhosrawi opened this issue Dec 22, 2024 · 12 comments
Open

my repeated test dosen't show in grafan #4348

hamedkhosrawi opened this issue Dec 22, 2024 · 12 comments

Comments

@hamedkhosrawi
Copy link

Your question

hi dears, i'm very thanksful about sitespeed.io and enjoy it when i work with, i have written a multi scripting test with below configuration, but when i run test with one slug name it seems metrics overwritten and when i choose different slug name it's goes appear, how can i resolve this?

{
  "browsertime": {
    "iterations": 1,
    "browser": "chrome",
    "chrome": {
      "traceCategories": "-*,disabled-by-default-lighthouse,v8,v8.execute,blink.user_timing,devtools.timeline,disabled-by-default-devtools.timeline,disabled-by-default-devtools.timeline.stack,disabled-by-default-devtools.timeline.frame,disabled-by-default-devtools.timeline.invalidationTracking,loading,latencyInfo"
    }
  },
  "slug": "shouldBeUnique",
  "graphite": {
    "host": "172.31.54.69",
    "port": 2003,
    "httpPort": 18080,
    "auth": "guest:guest",
    "namespace": "sitespeed_io.desktop",
    "logReceivedData": true
  },
  "metrics": {
    "filter": [
      "coach.pageSummary.advice.performance.adviceList.*.score",
      "coach.pageSummary.advice.bestpractice.adviceList.*.score",
      "coach.pageSummary.advice.accessibility.adviceList.*.score"
    ]
  },
  "axe": {
    "enable": true
  },
  "utc": false
}
@soulgalore
Copy link
Member

Hi @hamedkhosrawi ok, do you tets different pages or is the same page?

If you test the same page with the exact same key, the metric will be replaced depending on your Graphite setup:
https://www.sitespeed.io/documentation/sitespeed.io/graphite/#configure-graphite
Checkout

[sitespeed]
pattern = ^sitespeed_io\.
retentions = 30m:40d

That means that within 30 minutes for the exact same key, it will replace the values.

Do you test the exact same thing or do you want to keep the test data as separate?

@hamedkhosrawi
Copy link
Author

hi, thank for reply, i test exact same test, my goal is use sitespeed as synthetic job for measuring accessibility and performance of the multi scenario, i measure the loginpage, homepage and searchpage, should i decrease the value of retentions?

@soulgalore
Copy link
Member

How often do you plan to run the test? Graphite prepare space on disk depending on your configuration. The lower retention, the metrics will take up more space in disk.

@hamedkhosrawi
Copy link
Author

if this configuration is efficient, i configured my job for 45 min, it's enough for me
[sitespeed]
pattern = ^sitespeed_io.
retentions = 30m:40d

@soulgalore
Copy link
Member

soulgalore commented Dec 23, 2024

Ok, cool. Let me know how it works out and I'll close the issue.

@hamedkhosrawi
Copy link
Author

i put this configuration in storage-schema.conf, i tried for changing configuration but it dosn't work, then when i talked to you and i found out the problem 100% related to configration i delete whisper directory and everthing going to be ok, thank for reply, sitespeed is awsome,
[stats]
pattern = ^stats.*
retentions = 10s:6h,1m:6d,10m:1800d

[sitespeed_crux]
pattern = ^sitespeed_io.crux.
retentions = 1d:2y

[sitespeed_run]
pattern = ^sitespeed_io.(.).(.).run.

retentions = 10s:8d

[sitespeed]
pattern = ^sitespeed_io.
retentions = 10s:8d,1m:30d,5m:60d,10m:180d,30m:180d

and this is my script for measure:
import doLogin from "./commands/login.js";
import doSearch from "./commands/search.js";
import navigateTo from "./commands/navigation.js";

/**

  • @param {import('browsertime').BrowsertimeContext} context
  • @param {import('browsertime').BrowsertimeCommands} commands
    */
    export default async function (context, commands) {
    const username = "0998108";
    const password = "Aa1234";
    const baseUrl = "https://www.mysite.com/";
    const loginBtnElm =
    '//div[1]/div[contains(@Class,"selectAddress")]/div[1]/button';
    const addressListElm = '//div[contains(@Class,"selectAddress addressList")]';
    const OtimeCarouselElm =
    '//p[contains(@Class,"-rotate-90") and contains(text(),"پرتخفیف‌ترین ها")]';
    const closeAddressListElm =
    '//p[contains(text(),"انتخاب آدرس")]/following-sibling::div[1]/div';
    const backBtnElm = '//div[@Class="flex gap-x-2 relative"]//button[1]';
    const profileElm = '//a[@href="/profile"]';
    const UserAccountTiltleElm = '//h2[contains(text(),"حســـــاب کـــــاربری")]';
    const profileNameElm =
    '//div[@Class="p-4"]/div[contains(@Class,"rounded-2xl cursor-pointer")]/div[1]';
    const profileTitleElm = "//h2[contains(text(),'پروفایل')]";
    const applyChangesElm = "//div[contains(@Class,'bottom-0 py-6')]/button";
    const homeBtnElm = '//a[contains(@href,"/stores")]';
    const refreshmentElm =
    "//a[contains(@href,'/browse/refreshments')]//div[contains(@Class,'single-category-item')]";
    const snackChipsElm = "//a[@href='/category/snack-chips-cheesepuffs']";
    const biscuitsElm = "//a[@href='/category/biscuits']";
    const delayTime = 1000;

await commands.measure.start("LandPage");

await navigateTo(context, commands, baseUrl);
await commands.scroll.toBottom(delayTime);
context.log.info("Measured metrics for Landing Page.");
await commands.measure.stop();
await commands.click.byXpathAndWait(loginBtnElm);
await doLogin(commands, username, password);

context.log.info("Waiting for redirection to HomePage complete...");
await commands.wait.byXpath(addressListElm, 20000);

await commands.scroll.toBottom(delayTime);
context.log.info(
"Current page URL:",
await commands.js.run("return window.location.href")
);

await commands.js.run("window.scrollTo(0, 0)");
await commands.wait.byTime(500);
await commands.measure.stop();
await commands.measure.start("Otime");
await commands.click.byXpathAndWait(OtimeCarouselElm);
await commands.click.byXpath(closeAddressListElm);
await commands.scroll.toBottom(delayTime);
await commands.wait.byPageToComplete();
await commands.measure.stop();
await commands.click.byXpathAndWait(backBtnElm);
await commands.measure.start("Profile");
await commands.click.byXpath(profileElm);
await commands.wait.byXpath(UserAccountTiltleElm);
await commands.wait.byPageToComplete();
await commands.click.byXpathAndWait(profileNameElm);
await commands.wait.byXpath(profileTitleElm, 2000);
await commands.click.byXpathAndWait(applyChangesElm);
await commands.measure.stop();
await commands.click.byXpathAndWait(homeBtnElm);
await commands.wait.byPageToComplete();
await commands.measure.start("Refreshment");
await commands.click.byXpathAndWait(refreshmentElm);
await commands.scroll.toBottom(delayTime);
await commands.wait.byPageToComplete();
await commands.measure.stop();
await commands.measure.start("SnackChips");
await commands.click.byXpathAndWait(snackChipsElm);
await commands.scroll.toBottom(delayTime);
await commands.wait.byPageToComplete();
await commands.measure.stop();
await commands.measure.start("Biscuits");
await commands.click.byXpathAndWait(biscuitsElm);
await commands.scroll.toBottom();
await commands.wait.byPageToComplete();
await commands.measure.stop();
}

@hamedkhosrawi
Copy link
Author

i have an issue, my configuration file config.json

{
  "browsertime": {
    "iterations": 1,
    "browser": "chrome",
    "chrome": {
      "traceCategories": "-*,devtools.timeline,blink.user_timing,loading,latencyInfo",
      "clearCache": true
    }
  },
  "slug": "firstView",
  "graphite": {
    "host": "172.31.54.69",
    "port": 2003,
    "httpPort": 18080,
    "auth": "guest:guest",
    "namespace": "sitespeed_io.desktop"
  },
    "metrics": {
    "filter": [
      "browsertime.pageSummary.visualMetrics.*",
      "browsertime.pageSummary.timings.navigationTiming.*",
      "browsertime.pageSummary.browserScripts.timings.pageTimings.*",
      "browsertime.pageSummary.cpu.*",
      "coach.pageSummary.advice.performance.adviceList.*.score",
      "coach.pageSummary.advice.bestpractice.adviceList.*.score",
      "coach.pageSummary.advice.accessibility.adviceList.*.score"
    ]
  },
  "sustainable": {
    "enable": true
  },
  "axe": {
    "enable": true
  },
  "thirdParty": {
    "cpu": true
  },
  "plugins": {
    "remove": ["html"]
  },
  "utc": false

i run sitespeed with this command
nerdctl run --name sitespeed --network=host --privileged=true --shm-size=4g --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:35.7.2-plus1 --config config.json --multi measure.mjs
it's getting this error aftre sending metrics to graphite

<--- Last few GCs --->

[43:0x7527260] 501887 ms: Scavenge (reduce) 2043.0 (2077.6) -> 2042.9 (2078.3) MB, 10.05 / 0.00 ms (average mu = 0.457, current mu = 0.155) allocation failure;
[43:0x7527260] 502694 ms: Mark-Compact (reduce) 2043.9 (2078.3) -> 2043.9 (2079.3) MB, 804.17 / 0.00 ms (average mu = 0.337, current mu = 0.033) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0xb86ecf node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
 2: 0xef74d0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 3: 0xef77b7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 4: 0x1109355  [node]
 5: 0x11211d8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 6: 0x10f72f1 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 7: 0x10f8485 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 8: 0x10d4ba6 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
 9: 0x10c67d4 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node]
10: 0x10c8fb6 v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [node]
11: 0x1238578 v8::internal::JsonParser<unsigned char>::MakeString(v8::internal::JsonString const&, v8::internal::Handle<v8::internal::String>) [node]
12: 0x123d9dd  [node]
13: 0x123fa19 v8::internal::JsonParser<unsigned char>::ParseJson(v8::internal::Handle<v8::internal::Object>) [node]
14: 0xf892a1 v8::internal::Builtin_JsonParse(int, unsigned long*, v8::internal::Isolate*) [node]
15: 0x196adf6  [node]
/start.sh: line 52:    43 Aborted                 (core dumped) chroot --skip-chdir --userspec='sitespeedio:sitespeedio' / node "$@"

nodejs consumes all memory about 28GB and my rootfs grows about 80%, how can i resolve this? i need sending metrics to graphite and i can't store any file, because i have limited resources for disk

@soulgalore
Copy link
Member

nodejs consumes all memory about 28GB a

Are you sure? Usually nodejs the default memory limit is 2GB for NodeJS. You can increase that by following these instructions:
https://www.sitespeed.io/documentation/sitespeed.io/docker/#increase-memory - can you check if that's the problem?

@hamedkhosrawi
Copy link
Author

i increase the MAX_OLD_SPACE_SIZE=4096 and errors gone, but after sending metrics to graphite it's starting consume memory up to 28G, consumes 2G during execution but when logged those metrics on the console like below

[2024-12-25 15:47:41] INFO: https://www.site.com/category/desserts 67 requests, TTFB: 31ms, firstPaint: 376ms, firstVisualChange: 33ms, FCP: 376ms, DOMContentLoaded: 234ms, LCP: 810ms, CLS: 0.2716, TBT: 12.79s, CPUBenchmark: 54ms, Load: 11.78s, speedIndex: 3.39s, visualComplete85: 11.93s, lastVisualChange: 11.93s

it starts consuming memory

@hamedkhosrawi
Copy link
Author

i found the issue for my case, i put this block in json config then i remove that all issues gone

  "sustainable": {
    "enable": true
  },

@soulgalore
Copy link
Member

Hi @hamedkhosrawi ok, thanks for reporting, I'll check that implementation ASAP.

@hamedkhosrawi
Copy link
Author

Hi @soulgalore ,
Thank you for looking into it.
Best regards,
Hamed Khosravi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants