When we create a quote for delivery in Postmates, the response returns 2 params:
duration and pickup_duration.
Does duration include pickup_duration or duration is delivery estimation only for the route from the store to the customer and doesn't include the time to get to the store?
Thank you
Related
I am interfacing with a system which schedules appointments. The destination system does not allow appointments to be scheduled more than 30 days in advance, but the source system may send the appointment at any time (frequently beyond 30 days). How can I delay the delivery of the message till it is within the 30d window?
Create two channels. Have the first write the file to disk and set the "lastWriteTime" to the date you would like the message to be delivered. The second channel should read from this directory and use the "Check File Time" option to filter only those messages with historical dates.
Channel 1 destination 1:
Transformer Javascript:
channelMap.put('deliverAfter', msg['SCH']['SCH.11']['SCH.11.1'].toString());
Destination Settings:
Connector Type: Javascript Writer
var deliverAfter = DateUtil.getDate('yyyyMMddHHmm', $('deliverAfter'));
var path = 'c:/data/queue/' + connectorMessage.getMessageId();
org.apache.commons.io.FileUtils.writeStringToFile(new java.io.File(path), connectorMessage.getEncodedData(), 'UTF-8');
java.nio.file.Files.setLastModifiedTime(java.nio.file.Paths.get(path), java.nio.file.attribute.FileTime.fromMillis(deliverAfter.getTime()));
Channel 2:
Source reader settings:
Path: c:/data/queue/
After Processing Action: Delete
Check File Age: Yes
File age (ms): 1000
Encoding: UTF-8
To avoid queuing messages to meet the delay threshold expected at the destination, I would do a JavaScript filter on the source connector of the source system to only fetch appointments that the destination considers due. For further assistance, you can share a template of a source system message sample (arbitrary values not real data, I am only interested in the place holders).
Currently i am using declarative pipeline. In my email notification i want to pass build duration as well. Any idea how to post build duration in emailtext .
Use the durationString of the currentBuild:
def elapsed = currentBuild.durationString.replace(" and counting","")
It will give you the time elapsed until the calculation sentence, so you better activate it just before sending the email.
I have state change duration data between my object state in milliseconds.I am sending this data to graphite. I want to create a single stat panel which show me the percentage of the duration less than 20 seconds. How can I create it? Any idea or any similar scenario example will be useful.
myProjectName.FromStateToState.duration 10000ms
myProjectName.FromStateToState.duration 15000ms
myProjectName.FromStateToState.duration 21000ms
myProjectName.FromStateToState.duration 25000ms
myProjectName.FromStateToState.duration 30000ms
Assume for above scenario I expect my percentage should be %40. Because I have 5 duration data and 2 of them is less than 20 seconds. I am using Graphite as data source and Grafana as visualizing.
Temporary Solution
Because I couldn't get enough attention and any answer, I will add my temprorary solution to here. If I learn exact solution in the future I will post as an answer too.
Basically I created two counter like counterSuccess and counterFail. If state change duration is less than 20 seconds increase counterSuccess otherwise increase counterFail. Then get percentage of the success rate via following basic formula counterSuccess/(counterSuccess + counterFail).
Graphite commands at Grafana Panel:
A : sumSeries(myProjectName.FromStateToState.counterSuccess.count)
B : sumSeries(myProjectName.FromStateToState.counterFail.count)
C : sumSeries(#A, #B)
D : divideSeries(#A,#C)
I defined a single stat at grafana to show it as single percentage;
I'm very new to APIs, Java and all this things.
I Googled and over-googled things about the Google Analytics API and found very few answers. So I thought I'd post my question here.
The ga:avgSessionDuration returns the average sessions duration on my sites. But it returns in seconds and miliseconds. I want that number divided by 60 so I'll se minutes (as I see it on the Google Analytics website). But I have no clue how to do that and found no answer on Google.
Here is my code:
'dimensions': 'ga:yearMonth',
'metrics': 'ga:users,ga:pageviews,ga:avgSessionDuration',
'start-date': '2014-01-02',
'end-date': 'today',
'max-results': '12',
'sort': '-ga:yearMonth',
The return info is:
Month of Year Users Pageviews Avg. Session Duration
201505 18 25 27.894736842105264
201504 475 685 38.3062381852552
Another thing I hate is that the Months are printed out as "201505" instead of "May 2015".
Cheers. :)
As you can see from the documentation:
ga:avgSessionDuration
Web View Name: Avg. Session Duration The
average duration of user sessions represented in total seconds.
ga:sessionDuration / ga:sessions
The Reporting API returns the data to you in seconds. This is to make it easer for all developers to then format the information as they wish. You as a developer will need to loop though the results add your divide by 60 in order to format your data in minutes.
Google returns raw data formatting is up to us.
The same goes for Month of Year the standard format is YYYYMM you will need to format the data in your code.
I have a table of eBay itemid, and for each id I want to apply a reviseitem call, but from the second call I get the following error:
You have exceeded your maximum call limit of 3000 for 5 seconds. Try back after 5 seconds.
NB: I have just 4 calls.
How can I fix this problem?
ebay count the calls per second per unique IP's. So please make sure your all calls from your application must be less than 3000 per 5 seconds. hope this would help.
I have just finished an eBay project and this error can be misleading. eBay allow a certain amount of calla a day and if you exceed that amount in one 24 hour period you can get this error. You can get this amount increased by completing an Application Check form http://go.developer.ebay.com/developers/ebay/forums-support/certification
The eBay Trading API, to which your ReviseItem call belongs, allows up to 5000 calls per 24 hour period for all applications, and up to 1.5M calls / 24hrs for "Compatible Applications", i.e. applications that have undergone a vetting process called "Compatible Application Check". More details here: https://go.developer.ebay.com/developers/ebay/ebay-api-call-limits
However, that's just the generic, "Aggregate" call limit. There are different limits for specific calls, some of which are more liberal (AddItem: 100.000 / day) and others of which are more strict (SetApplication: 50 / day) than that. Additionally, there are hourly and periodic limits.
You can find out any application's applicable limits by executing the GetApiAccessRules call:
<GetApiAccessRulesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2014-12-02T13:25:43.235Z</Timestamp>
<Ack>Success</Ack>
<Version>889</Version>
<Build>E889_CORE_API6_17053919_R1</Build>
<ApiAccessRule>
<CallName>ApplicationAggregate</CallName>
<CountsTowardAggregate>true</CountsTowardAggregate>
<DailyHardLimit>5000</DailyHardLimit>
<DailySoftLimit>5000</DailySoftLimit>
<DailyUsage>10</DailyUsage>
<HourlyHardLimit>6000</HourlyHardLimit>
<HourlySoftLimit>6000</HourlySoftLimit>
<HourlyUsage>0</HourlyUsage>
<Period>-1</Period>
<PeriodicHardLimit>10000</PeriodicHardLimit>
<PeriodicSoftLimit>10000</PeriodicSoftLimit>
<PeriodicUsage>0</PeriodicUsage>
<PeriodicStartDate>2006-02-14T07:00:00.000Z</PeriodicStartDate>
<ModTime>2014-01-20T11:20:44.000Z</ModTime>
<RuleCurrentStatus>NotSet</RuleCurrentStatus>
<RuleStatus>RuleOn</RuleStatus>
</ApiAccessRule>
<ApiAccessRule>
<CallName>AddItem</CallName>
<CountsTowardAggregate>false</CountsTowardAggregate>
<DailyHardLimit>100000</DailyHardLimit>
<DailySoftLimit>100000</DailySoftLimit>
<DailyUsage>0</DailyUsage>
<HourlyHardLimit>100000</HourlyHardLimit>
<HourlySoftLimit>100000</HourlySoftLimit>
<HourlyUsage>0</HourlyUsage>
<Period>-1</Period>
<PeriodicHardLimit>0</PeriodicHardLimit>
<PeriodicSoftLimit>0</PeriodicSoftLimit>
<PeriodicUsage>0</PeriodicUsage>
<ModTime>2014-01-20T11:20:44.000Z</ModTime>
<RuleCurrentStatus>NotSet</RuleCurrentStatus>
<RuleStatus>RuleOn</RuleStatus>
</ApiAccessRule>
You can try that out four your own application by pasting an AuthToken for your application into the form at https://ebay-sdk.intradesys.com/s/9a1158154dfa42caddbd0694a4e9bdc8 and then press "Execute call".
HTH.