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: 16
Posts: 16   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 3643 times and has 15 replies Next Thread
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
biggrin How to format the API query URL on Modtime?

Got a massive problem... too many records to handle being returned, 28000 and counting, so decided to revisit the API filter options which says:
Optional parameters are (can be combined):

Limit: Defines the number of results returned. Default is 25.
Offset: Defines how many results are skipped before the API returns any data. Default is 0.
SortBy: Defines the sorting order of the results. Options are: DeviceId, SentTime, ReportDeadline, ReceivedTime or CpuTime. Default is SentTime.
Format: The format of the data. Options are XML or JSON. Default is JSON.
ModTime: Return results which were last modified on or after this time. This value is a Unixtimestamp (number of seconds since midnight Jan 1 1970).
ServerState: Return results based on whether they are currently in progress or have already been reported back to World Community Grid. 4 would return in-progress results, 5 would return results which have already been reported back to the server.
Outcome: Return results based on the outcome of their processing. 1 means success, 3 means error, 4 means no reply, 6 means validation error, 7 means abandoned./
ValidateState: Return results based on the validation status. 0 means pending validation, 1 means valid, 2 means invalid, 4 means pending verification, 5 means results failed to validate within given deadline.


What I wanted to achieve was primary sort on Received Time, then secondary filter on the Modtime, on or after, with the latter part of the URL formatted as follows, the Modtime seconds per unix at start of this statistics period which is 1481500800 aka 161212 at 00:00:00

&format=xml&limit=250&offset=0&ServerState=5&SortBy=ReceivedTime&=ModTime=1481500800

What is being returned as top record with application of an offset of 250 is a result with a modtime from before the last modified on or after this time ... the query response does not want to be convinced to adhere to my requirements

<?xml version="1.0" encoding="UTF-8" ?>
- <ResultsStatus>
<ResultsAvailable>860</ResultsAvailable>
<ResultsReturned>250</ResultsReturned>
<Offset>250</Offset>
- <Result>
<AppName>fahv</AppName>
<ClaimedCredit>17.04168537594135</ClaimedCredit>
<CpuTime>1.1776388883590698</CpuTime>
<ElapsedTime>1.1856697797775269</ElapsedTime>
<ExitStatus>0</ExitStatus>
<GrantedCredit>17.04168537594135</GrantedCredit>
<DeviceId>3483292</DeviceId>
<DeviceName>uhuh</DeviceName>
<ModTime>1481498153</ModTime>
<Name>FAHV_1000137_4xfx_P1_Rigid_4525_0</Name>
<Outcome>1</Outcome>
<ReceivedTime>2016-12-11T23:15:48</ReceivedTime>
<ReportDeadline>2016-12-21T10:30:35</ReportDeadline>
<SentTime>2016-12-11T10:30:35</SentTime>
<ServerState>5</ServerState>
<ValidateState>1</ValidateState>
<FileDeleteState>2</FileDeleteState>
</Result>

Is this a bug, or is it me, the construction of the URL query (I hope so, as that's quickly adjustable).

Many thanks in advance (fellow API utilizers too if they know the answer)

edit: Questionmark in title of course
----------------------------------------
[Edit 1 times, last edit by Former Member at Dec 12, 2016 2:33:07 PM]
[Dec 12, 2016 11:08:47 AM]   Link   Report threatening or abusive post: please login first  Go to top 
Crystal Pellet
Veteran Cruncher
Joined: May 21, 2008
Post Count: 1413
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: How to format the API query URL on Modtime?

&format=xml&limit=250&offset=0&ServerState=5&SortBy=ReceivedTime&= ModTime=1481500800

I think the red = sign is too much, but I'm surely not an API-expert; even not a API-user.
[Dec 12, 2016 2:44:24 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: How to format the API query URL on Modtime?

Thanks for that CP... don't know why I typed the extra = , so verified for the new period, from the top, no offset this time

&format=xml&limit=250&offset=0&ServerState=5&SortBy=ReceivedTime&Modtime=1481587570

and got records earlier than the desired ModTime.

<?xml version="1.0" encoding="UTF-8" ?>
- <ResultsStatus>
<ResultsAvailable>30751</ResultsAvailable>
<ResultsReturned>250</ResultsReturned>
<Offset>0</Offset>
- <Result>
<AppName>mcm1</AppName>
<ClaimedCredit>114.5433955084077</ClaimedCredit>
<CpuTime>5.01069450378418</CpuTime>
<ElapsedTime>5.090649604797363</ElapsedTime>
<ExitStatus>0</ExitStatus>
<GrantedCredit>0.0</GrantedCredit>
<DeviceId>3483292</DeviceId>
<DeviceName>uhuh</DeviceName>
<ModTime>1481554099</ModTime>
<Name>MCM1_0128450_9796_1</Name>
<Outcome>1</Outcome>
<ReceivedTime>2016-12-12T14:48:19</ReceivedTime>
<ReportDeadline>2016-12-18T21:35:07</ReportDeadline>
<SentTime>2016-12-11T21:35:07</SentTime>
<ServerState>5</ServerState>
<ValidateState>0</ValidateState>
<FileDeleteState>0</FileDeleteState>
</Result>

Would the filter work, there'd be need for pulling over 11,500 records for the last period instead of now > 30K with Serverstate 5, representing a massive improvement in execution time.
[Dec 12, 2016 3:00:33 PM]   Link   Report threatening or abusive post: please login first  Go to top 
foxfire
Advanced Cruncher
United States
Joined: Sep 1, 2007
Post Count: 121
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: How to format the API query URL on Modtime?

I'm seeing the same as you. Asked to pull results with mod time of 1481503715 or greater (no sort). Got 2208 results returned of which 693 had mod time older than requested. In my pull the older results didn't start until record 756 (relative to 1).

URL: https:// secure.worldcommunitygrid.org/api/members/foxfire/results?code=my_ver_code&ModTime=1481503715&Offset=x&limit=250&format=json
I start my offset at 0 and pull 250 at a time..
----------------------------------------

[Dec 12, 2016 4:13:09 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: How to format the API query URL on Modtime?

Bump @ Techs. This bug is stalling the development progression.
[Dec 22, 2016 1:59:53 PM]   Link   Report threatening or abusive post: please login first  Go to top 
ErikaT
Former World Community Grid Admin
USA
Joined: Apr 27, 2009
Post Count: 912
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: How to format the API query URL on Modtime?

Bump @ Techs. This bug is stalling the development progression.
Hi Sek,
I have notified the team. Thank you in advance for your patience with response time biggrin

ErikaT
[Dec 22, 2016 3:13:01 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: How to format the API query URL on Modtime?

We have a deployed a change that should resolve this issue. If you could test with your apps and let us know that would be great!
[Dec 22, 2016 11:28:57 PM]   Link   Report threatening or abusive post: please login first  Go to top 
wujj123456
Cruncher
Joined: Jun 9, 2010
Post Count: 40
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: How to format the API query URL on Modtime?

We have a deployed a change that should resolve this issue. If you could test with your apps and let us know that would be great!

Did the update break some filters? I usually query with ValidateState=1 and now it just returns 500. Removing ValidateState=1 works fine.
[Dec 23, 2016 7:19:00 AM]   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: How to format the API query URL on Modtime?

We have a deployed a change that should resolve this issue. If you could test with your apps and let us know that would be great!

The combination of Offset & Limit & ServerState & ReceivedTime & ModTime works a treat now [:ThumbsUpSmiley]. Adding (small) validationstate= or proper ValidationState= seems ineffective with any of the VS codes, 0, 1, 2, 4 or kicks out an error, noting that if modtime (small) is used it does not work but if ModTime (Proper) is used, it works i.e. the call seems to be case sensitive (superficial testing).
[Dec 23, 2016 1:22:13 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: How to format the API query URL on Modtime?

BTW, may have asked about this before but an inverse filter would also be great e.g. ValidationState<>0 or Outcome<>7 (who's interested in pulling aborted tasks with zero runtime, which brings me to just pulling ServerState=5 and CPUTime>0, as an additional filter tag, or CPUTime=1 meaning has runtime ;?)

From the creative commons department, and only if you have the hour spare to be creative. ;P)
[Dec 23, 2016 1:43:35 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Posts: 16   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread