Index  | Recent Threads  | Unanswered Threads  | Who's Active  | Guidelines  | Search
 

Quick Go »
No member browsing this thread
Thread Status: Active
Total posts in this thread: 18
Posts: 18   Pages: 2   [ Previous Page | 1 2 ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 3993 times and has 17 replies Next Thread
adriverhoef
Master Cruncher
The Netherlands
Joined: Apr 3, 2009
Post Count: 2346
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: API is not returning any result data since sometime after 14:57(2:57PM) UTC

Kevin, hopefully you are looking at the good thing now. :-)
Here's what I'm using:
${HTTPS}www.worldcommunitygrid.org/api/members/<membername>/results?code=<code>&format=json&ServerState=5&SortBy=CpuTime&Offset=0&Limit=0
It is currently returning 0 results, as lavaflow mentioned, although there are results available.

This is what I get:
{"ResultsStatus": {
"ResultsAvailable": "327",
"ResultsReturned": "0",
"Offset": "0",
"Results": [
]
}
}

I think 'Limit=0' was never official. Can it officially be used from now on (as soon as it works again biggrin )?
EDIT: To retrieve the maximum number of results allowed, of course.
----------------------------------------
[Edit 2 times, last edit by adriverhoef at Jan 23, 2020 1:19:05 AM]
[Jan 22, 2020 1:35:18 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: API is not returning any result data since sometime after 14:57(2:57PM) UTC

Anyone interested in retrieving zero records;?

Come to think of it, though 0 is enormously helpful to just one-pass pull everything, like entering limit=1048575, since my spreadsheet will take only 1 more (reserved for the table header), the 0 return still tells how many records there are to fetch in the loop. Think 1,000 is already a big improvement over 250, not to speak of the default of 25 if nothing is specified or something is wrong, the 'wrong' now also giving 0.
----------------------------------------
[Edit 1 times, last edit by Former Member at Jan 22, 2020 1:51:41 PM]
[Jan 22, 2020 1:48:08 PM]   Link   Report threatening or abusive post: please login first  Go to top 
adriverhoef
Master Cruncher
The Netherlands
Joined: Apr 3, 2009
Post Count: 2346
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: API is not returning any result data since sometime after 14:57(2:57PM) UTC

What about trying to retrieve a negative number of records? devilish Well, at least it works! laughing That is, you'll get all — to the maximum extent permitted — available results:

{"ResultsStatus": {
"ResultsAvailable": "327",
"ResultsReturned": "327",
"Offset": "0",
"Results": [
… is what I get when using limit=-1.
[Jan 22, 2020 5:28:34 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: API is not returning any result data since sometime after 14:57(2:57PM) UTC

Lol, like some of the BOINC cc_config options. I'll try that in a mom.

Edit: OFLMBO, it works. Superb out-of-the-box find.
----------------------------------------
[Edit 2 times, last edit by Former Member at Jan 22, 2020 5:43:59 PM]
[Jan 22, 2020 5:39:47 PM]   Link   Report threatening or abusive post: please login first  Go to top 
knreed
Former World Community Grid Tech
Joined: Nov 8, 2004
Post Count: 4504
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: API is not returning any result data since sometime after 14:57(2:57PM) UTC

I found the behavior. In hibernate, when "setMaxResults" is called with a 0 or negative number, the behavior is not defined. In the older version of hibernate setting it to 0 would return all results. In the new version, 0 returns 0 results. As you observed a negative value will also return all results.

However, there is discussion that they might make it an error to call the function with 0 or lower.

In order to preserve the behavior and make limit=0 official, I've modified the code so that if limit is 0 or less, then setMaxResults is not set and therefore all results will be returned. This code will be on production in the next 30 minutes or so. I'll post when it is available.
[Jan 22, 2020 9:29:54 PM]   Link   Report threatening or abusive post: please login first  Go to top 
knreed
Former World Community Grid Tech
Joined: Nov 8, 2004
Post Count: 4504
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: API is not returning any result data since sometime after 14:57(2:57PM) UTC

This change has been deployed. limit=0 will work as it previously did (but now for the right reasons rather than a quirk of the underlying library).
[Jan 22, 2020 9:58:47 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: API is not returning any result data since sometime after 14:57(2:57PM) UTC

Many thanks for the arduous labor. 😎
[Jan 22, 2020 10:10:52 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: API is not returning any result data since sometime after 14:57(2:57PM) UTC

This change has been deployed.

There's 'This change' and am asking about 'That change' of upping the record limit to 500 or 1000 per fetch request. Just tried today with 500 but good old 250 keeps coming back.

As for features, it would be great if only the records can be pulled after a certain <ModTime> timestamp. That would reduce the number of records to fetch to probably a quarter to just those that had a transaction in the last 12 hours i.e. the duration of a statistics period.

Thanks for your attention.
[Feb 7, 2020 4:03:22 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Posts: 18   Pages: 2   [ Previous Page | 1 2 ]
[ Jump to Last Post ]
Post new Thread