Search word by word to API - ios

I have textfield has .editedChanged event.
when user type "Boy" it will send :
"B" send to API for search and waiting for responding.
"Bo" send to API for search and waiting for responding.
"Boy" send to API for search and waiting for responding.
The problem is , it will request 3 times to server and get 3 times of responding from server.
****How can i send only 1 time "Boy" send to API for search and waiting responding ??

An effective way to do this is to monitor how long of a delay there is between user input, and only request to the server after the user has stopped typing for x amount of time.
For instance, the user types 'B' and waits 0.05 seconds then types 'o' and waits 0.08 seconds then types 'y' and stops typing.
If your code only submits to the server after there has been at least 0.5 seconds between character input, it will only request to the server once, after "Boy" has been entered.

Related

Loop count with conditiions

I have a scenarios in Neoload scripting.
Based on the request response variable count, need to loop the next request.
ex: If the respose variable count is 21, then i should the run the next request 3 times with page1,2,3 and if it 20 then 2 times. How to acheive this? Its actually a pagination with 10.

Splunk panel showing graph for a specific time range

I am working with splunk. I want to pull logs for an api call for a specific range of time 9.30pm to 12:00 am on daily basis. Also, the average time taken for the call duraing that specific duration.
index="index_a" sourcetype="pqr" source="prq_source" "Success in api response"
Can someone guide me how to handle this how we can fetch for that particular duration for atleast 7 days.
Something like this should work (so long as you have the automatic field date_hour created by Splunk):
index="index_a" sourcetype="pqr" source="prq_source" "Success in api response" earliest=-7d
| where (date_hour>=21 AND date_minute>=30) OR date_hour>=22
| stats avg(call_duration) as avg_call by success_id
If date_hour & date_minute aren't being automatically supplied by Splunk, you can create them yourself with strftime:
| eval date_hour=strftime(_time,"%H"), date_minute=strftime(_time,"%M")

Relative/Dynamic lookback time for alerts in InfuxDB

I am sending events to InfluxDB which are timestamped. These are basically events to external service. I wanted to set an alert which would execute if the count of such events from 12 AM today to now() extends a certain number, an alert should be raised.
I have checked out Influx but it seems that you can lookback only some constant time such as 5 mins, 10 mins, 1 hr, 12 hr, 1 day etc from now(). But for me the lookback is dynamic.
Please help with some pointers to achieve this.

how to stop False alert in zabbix while monitoring any port or service in zabbix

My zabbix server sends alerts immediately when a service gets failed
my item for monitoring a port:
net.tcp.listen[80]
my trigger for monitoring a port:
{Testserver:net.tcp.listen[80].last()}=0
It does not seem to be a false alert - you have configured your trigger to be too sensitive for your needs. While you didn't specify it, it seems that you want to make the trigger less sensitive. One way to do so:
{Testserver:net.tcp.listen[80].max(300)}=0
This will alert when the maximum value over last 300 seconds - 5 minutes - will be 0. Thus it will alert when the service will be down continuously for 5 minutes. For convenience, you can also write it like this:
{Testserver:net.tcp.listen[80].max(5m)}=0
I fixed it with the same thing using max() function
{Testserver:net.tcp.listen[80].max(#5)}=0
It which will check 5 consecutive checks if the value 0 remains same for all check it will trigger the alert
After that i increased the update interval in item default it is 30 seconds and i increased to 60 seconds so that it will check for 5 times every 1 minute

Twilio Call/recording Time Out

I am working in twilio call and recording process , everything going fine till the call goes below 1 hour , if it exceeds i got response like this 'i got TIMEOUT'
**[Called] => +18445184466
[Digits] => timeout
[RecordingUrl] => https://api.twilio.com/2010-04-01/Accounts/AC0208c3ffe80b07bebe8ca07eea206179/Recordings/REc0726376f9485aa2005870bc6f9f3ce8**
......
Call disconnected after 1 hour even i set
$response->record(array('timeout' =>100000));
Please help how to achieve recording after 1 hour without call disconnect?
Thanks
Twilio developer evangelist here.
When using <Record> to record a call the maximum length by default is 1 hour. You can increase the maximum length of the recording by setting the maxLength attribute. This is set in seconds and by default is 3600 (one hour). You can set it up to the maximum length of a call: 14400, which is 4 hours.
$response->record(array('maxLength' => 14400));

Resources