how do I control output from angular-moment - angularjs

I am using angular-moment library. Essentially, I want to show the time difference in minutes between now and some time in the model. Ideally, the display must be dynamic; so the user doesn't need to refresh the page in order to see updates.
<span am-time-ago="message.time"></span> works and works dynamically. But it shows user-friendly messages "a few seconds ago, 2 minutes ago, etc. I need the actual value in minutes (30 means in 30 minutes, -120 means I am 2 hours late, etc.)
Everything else, for example moment(myJsonValue).diff(moment(), 'minutes') is not dynamic. Is there a way to have both dynamic and numeric?

Related

Gatling Throttle holdfor not working

New to Gatling world but an experienced Loadrunner user.
I created a sample simulation to run two scenarios, each with 10 users and want to run it for 10 minutes. Below is what I have in my setUp function. But each time I run the simulation, it only runs for 136 seconds. The holdFor doesn't seem to take into effect.
setUp(
scn.inject(rampUsers(10) over (10 seconds)),
scen.inject(rampUsers(10) over (10 seconds))
)
.protocols(httpProtocol)
.throttle(
reachRps(2) in (10 seconds),
holdFor(10 minutes)
)
I am using Gatling 2.2.2 bundle.
Output: Simulation computerdatabase.BasicSimulation completed in 136 seconds
The throttle works as a bottleneck, effectively working as an upper boundary for how many requests will be sent. If your scenarios + injection profiles aren't able to generate as many requests as you would like in the first place, the ones that are generated simply pass through the throttle unhindered. The throttle cannot increase the load to match the desired RPS, it can only decreases it.
You will need to inject enough users into your scenarios for them to be able to generate the 2 RPS you want in the first place, and keep adding more of them over the course of the simulation, in order for the throttle to do what you are looking for.
Try changing your injection profiles to for example something like this (and adjust the constantUsersPerSec value as needed), I believe this might give you a load-profile a step closer to what you are looking for:
scn.inject(constantUsersPerSec(1) during(10 minutes))),
scen.inject(constantUsersPerSec(1) during (10 minutes)))
The example above was just a very quick and dirty way to illustrate the point of having to inject users over time, but as chance would have it, injecting 600 users in total over 10 minutes into a scenario is 10 users every ten seconds and should be exactly what you want, unless I'm falling ass first into a basic arithmetic error and/or misunderstanding.
It will also naturally ramp up and down to some extent, although you can more explicitly control the ramp up by chaining injection steps if you need, for example like this:
scn.inject(
rampUsers(10) over (1 minute),
constantUsersPerSecond(1) during (10 minutes)
)
For another approach to more explicitly control the ramp over time, you could also play around with a configuration like this:
scn.inject(
splitUsers(600) into(rampUsers(10) over(10 seconds)) separatedBy(10 seconds)
)

How to change Minimum Time and Maximum Time in AngularJS ui.calendar

I am working on a ui.calendar provided by AngularJS. By default the minimum time is 12 AM and maximum time is 11:30. I have made a bit changes to display time for every 30 mins.
I want to display the minimum time dynamically according to different users. Even if dynamically is not possible, I need to display it from 8AM.
I have tried so many answers on other similar questions but those are not working for me.
Can somebody help me with this?

What useful information can I get from my heatmap?

I have some sort of a heatmap and I can see how my users are using my website. Now I know where they are clicking, how much time it costs to complete a set of instructions, how much do they navigate between pages, etc.
So given that I have information with of this kind:
12/12/2014 12:45:00 - User pressed button 1 on page 1
12/12/2014 12:45:15 - User pressed button 2 on page 1
12/12/2014 13:00:00 (15 minutes delay) - User pressed button 3 on page 1
Now comes the hard part - how do I process this kind of information? For example how do I know that the user is lost on my website (if there is 15 minutes delay - does this means that his phone rang or my UI is bad?). And also - how can I find some patterns in large amount of data - say every third user spends 15 minutes after the second click to find what he has to click next.
What is the correct approach here? Thanks.
In order to derive useful information from raw data you need some context. You need to be clear about what expected user behaviour is and, where appropriate, what you are aiming for the user to do (eg. buy a product, register, make a comment etc.).
For example, if you have an event splash page with a big button to book a place, and you find that a lot of people click on that button very soon after they arrive, that's probably a good thing. If you have a page full of important information that you want people to read, and they click away just as quickly - that's really not a good thing.
It sounds obvious but so many people fall in to the trap of trying to evaluate user behaviour without being clear about the context - and without acknowledging that the very same number can mean very different things depending on that context.
Evaluate each page of major section of your site and outline what is there, and how you'd expect users to interact with it. How long would you expect a user to spend on that page? Where would be the logical place to go next? Is this a logical place to leave the site (I booked, I'm done), or is a user leaving the site here a failure? And so on. Then compare these expectations to the reality you see from your heat map.
Don't get too hung up on individual cases - if one person took 15 minutes on a page that should take 30 seconds, that was probably the phone ringing. If 90% of visitors take 15 minutes, then your page needs re-evaluating.
Lastly, pay as much attention to what people don't do as what they do. Everyone's eye is drawn to the bright spots on a heat map or the rows at the top of a chart with big numbers. With analytics, a lot of the most useful information is what you expected to see people doing, but they aren't. Again, to realise this information you need to have defined that expected behaviour.

Response time loading is not correct

i can record the simulation through Gatling and able to run the simulation, but i am getting less load time compared to actual UI (User Interface) when generating the reports.
In my case actual load time when i click on some button(one request,it internally loads some data) on UI is almost 3 to 4 mins, but in reports it will show 300 ms...
i can clicked the button then it will take 2 to 4 minutes after that it open one excel, this during time not coming the reports, the reports giving time 300 or 360 ms.
the button url placed script in scala and run again but it gives wrong loading time(360 ms)
Thanks in advance,
any suggestions are helpful to me.

Specific (not random) add time to imacros with each replay

In the following post Sleep a random time in with iMacros, works on FireFox/Chrome plugin
it describes how to add RANDOM time to replays.
My question: Is there a way to add a SPECIFIC amount of time to each replay either via the macro file or batch file.... such as it plays the first time at say 6pm, then the second time it plays same time the next day PLUS 2 minutes (so 6:02pm) then the third day another 2 minutes added (6:04pm) ??
Im running the macro from a batch file, so I could put it in there if there is a way.... ?? any ideas?
Yes.
But for this you need JavaScript scripting and a use of Date() objest in JS. Also look at this.
How do I get the current time only in JavaScript

Resources