question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LogStats Extension should log the IPM and RPM to the stats on spider_closed signal

See original GitHub issue

Summary

By default, the scrapy.extensions.logstats.LogStats log the details below to the standard logger every 60 seconds:

  • IPM (Items per Minute)
  • Items scraped
  • RPM (Requests per Minute)
  • Requests produced

Motivation

We often find the need to retrieve the RPM and IPM after a job is finished. We can calculate this manually or we can check the logs for the last update of LogStats. However, this is tedious and inefficient as LogStats already has this data but isn’t putting them somewhere that is readily available after the job is finished.

Describe alternatives you’ve considered

We can pull out the last update of LogStats from the logs but pulling it from the API and filtering it out is expensive.

Additional context

None

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
BurnzZcommented, Nov 1, 2019

Ahhh I see what you mean now @Gallaecio. Great catch! 🎉 I’ve updated the PR now for this new approach. 😃 Let me know what you think. If all is good with this approach I’ll proceed in writing the tests.

0reactions
Gallaeciocommented, Nov 1, 2019

#4111 would log 100 in this case, right? Shouldn’t we instead log the totals divided by the run time (200 in this case)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source code for scrapy.extensions.logstats
Source code for scrapy.extensions.logstats. import logging from twisted.internet import task from ...
Read more >
Pest and plant models, degree-days, and weather - UC IPM
UC IPM offers interactive tools and models that can help you make pest management decisions based on conditions at your site. California weather...
Read more >
Speed and Feed Calculator | Kennametal
The proper speed and feed help improve tool life and remove material at the optimal rate. Find SFM, IPM, RPM, and more here....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found