Skip to content

Add number of triples count to the wiki daily metric table#919

Merged
rosalieper merged 3 commits into
mainfrom
T391386
Apr 30, 2025
Merged

Add number of triples count to the wiki daily metric table#919
rosalieper merged 3 commits into
mainfrom
T391386

Conversation

@rosalieper
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread app/Metrics/App/WikiMetrics.php Outdated
if ($oldRecord->pages === $todayPageCount) {
\Log::info("Page count unchanged for WikiMetrics ID {$wiki->id}, no new record added.");
return;
\Log::info("Page count unchanged for Wiki ID {$wiki->id}, no new record added.");
Copy link
Copy Markdown
Contributor

@tarrow tarrow Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof, logic gets complicated here I think again but in this case a new record could still be added if the number of triples changes right?

That means this Log is a bit confusing

I wonder if we now want to pull out all this logic into it's own method(s) to make it easier for humans to parse (and ensure we get the messages we send to users right)?

Comment thread app/Metrics/App/WikiMetrics.php Outdated
return;
\Log::info("Page count unchanged for Wiki ID {$wiki->id}, no new record added.");
if ($oldRecord->number_of_triples === $tripleCount) {
\Log::info("Number of tripples unchanged for Wiki ID {$wiki->id}, no new record added.");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\Log::info("Number of tripples unchanged for Wiki ID {$wiki->id}, no new record added.");
\Log::info("Number of triples unchanged for Wiki ID {$wiki->id}, no new record added.");

@tarrow
Copy link
Copy Markdown
Contributor

tarrow commented Apr 17, 2025

Explodes for me locally when testing due to the TLS cert issues there.
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://asdfasdf.wbaas.dev/query/sparql?query=SELECT%20%28COUNT%28%2A%29%20AS%20%3Ftriples %29%20WHERE%20%7B%20%3Fs%20%3Fp%20%3Fo%20%7D

At the moment I would think the best thing to do would be to import the certificates like we do for the tools (see: wbstack/quickstatements@fe7ecd9)

@rosalieper rosalieper force-pushed the T391386 branch 2 times, most recently from 36eb599 to 6c7b569 Compare April 24, 2025 15:07
use App\WikiDailyMetrics;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels nicer to me than \Log in line. Thanks!

@rosalieper rosalieper merged commit 2d7c0f4 into main Apr 30, 2025
5 checks passed
@rosalieper rosalieper deleted the T391386 branch April 30, 2025 08:32
@rosalieper rosalieper restored the T391386 branch April 30, 2025 09:20
deer-wmde pushed a commit that referenced this pull request Dec 15, 2025
* Add number of triples count to the wiki daily metric table

* use the queryservice namespace entry point to count the triples

* fix tests
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

Successfully merging this pull request may close these issues.

2 participants