I'm using (not programming) an application that sends my browser, using a technology called "lightstreamer" (which i have no clue about), data every second or so (I guess using AJAX?). these are constant changing stock values.
Now... is there any program/thing I can use to automatically fetch/sniff/whatever the raw data that my browser gets, so that for example i could later paste it to Excel and create charts?
Why not just copy the data from the browser window you might ask, and the reason is that the application always shows me only the last 20 values for a given stock, and i wish to automatically get, let's say, the last 1,000 values and throw it to Excel.
Thanks :)
PS I see that the app is written in asp id it matters.
There is no way that I know of to (easily) reconstruct sniffed Lightstreamer communications into tabular data. Lightstreamer pushes updates to the client using a hidden IFRAME, but those updates are efficient, but intended for consumption only by the Lightstreamer client code.
Developers using the Lightstreamer Javascript API can easily hook into update events if they wish to.
However as an application user, you are best off raising a change request with the application owner to add some form of Excel export functionality.
Related
I'm trying to learn some basic knowledge of jsp, suppose that I have a project, in this project, after signing in, I have a Main.jsp with a calendar or a dropdown list in it, when selecting a date, I'll change the UI based on the data from database.
I can put all relevant data into request after signing in, and use JSTL in Main.jsp, but if the data is huge, this doesn't sound like a good idea, right?
Back to the old age when there's no JSTL or AJAX, how does jsp developer deal with this? And what is the best practice nowadays?
Thanks.
If you are talking to render about without JSTL or AJAX, the only option i see is to submit/send the form to server and get it back with updated view, but yes it will cost a lot in terms of performance.
I think for your use case:
1) you can get the data from server via AJAX on every update,
2) or, if the data is not customer dependent and is fixed in terms of UI, you can load it lazily in background, and change the view immediately on the user action.
I have a Ext.grid.Panel and I fill it with store that is populated from database. And there is an export button. When the user click on the Export button, I want the data from grid should start downloading like .csv file
The best solution to creating any type of file (Excel, CSV, PDF, whatever) is going to be leveraging your application server to create and serve up the file for download. There are literally thousands of libraries across most of the popular server-side languages that can create just about any kind of file that you'd want to create.
So ultimately this has nothing to do with Ext JS or even JavaScript. All that your export button should do, IMO, is to create an AJAX request which triggers the process (query, transform results, publish to a correct content type, stream to browser) that will be needed to generate the content from your application server technology.
Sometimes you can't leverage an application server such as when your back end is a micro controller or you can't get the back end people to make the change.
I've not used this, but it looks nice:
http://www.sencha.com/forum/showthread.php?136598-Export-store-to-Excel
I'd like to implement some visual indicator of various sections for the items whose status is pending in my app similar to facebook's / google plus unread notification indicator...I have written an API to fetch the count to be displayed, but I am stuck at updating it everytime an item gets added or deleted, I could think of two approaches which I am not satisfied with, first one being making an API call related to the count whenever a POST or DELETE operation is performedSecond one being refreshing the page after some time span...
I think there should be much better way of doing this from server side, any suggestion or any gem to do so?
Even in gmail it is refreshed on client request. The server calculates the amount of new items, and the client initiates a request (probably with AJAX). This requires an almost negligible amount of data and process time, so probably you can get away with it. Various cache gems even can store the part of the page refreshed if no data changed since last request, which even solves the problem of calculating only when something changed.
UPDATE:
You can solve the problem basically two ways: server side push, and a client side query. The push is problematic, for various reasons, rarely used in web environment, at least as far as I know. Most of the pages (if not all) uses timed query to refresh such information. You can check it with the right tool, like firebug for firefox. You can see as individual requests initiated towards the server.
When you fire a request trough AJAX, the server replies you. Normally it generates a page fragment to replace the old content with the new, but some cache mechanism can intervene, and if nothing changed, you may get the previously stored cache fragment. See some tutorial here, for various gems, one of them may fit your needs.
If you would prefer a complete solution, check Faye (tutorial here). I haven't used it, but may worth a try, seems simple enough.
I am new to MVC and from what I understood so far, each web request is independent, and in the controller you usually create a new Model object and load it from some data source.
That's great when you work against a DB and load the model object you need.
But what if my data source is a live real-time streaming data, and when the user click on a button I need to give him the last data I got from the stream ?
The simplest example I can think of is stock data:
Assume that I have a data source object that connects to the exchange and subscribes to a live feed of stock prices, and, when the client click on a button "Get last quote", I need to return the latest price I got (note: I do NOT need to stream data to the client, only return a snapshot when he clicks, or every 5 seconds etc).
So what I'm looking to do is, when the application starts create my static data source object, have it connected to the exchange and start listening to the feed, on each price change it stores it on some local variable, and in my Controller all I need to do is to call to my static data source and ask for the last tick (and it will return the value of the local variable).
Hope my question is clear. I know, it might be simple, but I just don't know, what is the correct pattern for this in MVC. Any ideas?
I would create it from 4 parts:
background process/daemon which continuously pushes stock data to NoSQL database
main application, which serve the web site
javascript driver frontend app, either listening to open socket or requesting data each few seconds
data provider, which pulls information from NoSQL and handles the frontend requests
It would make sense to use some MVC-inspired patterns for main application and frontend (yes, two MVC triads). But the rest are just glorified transaction scripts.
I used some load testing tools like siege, apache jmeter, httperf which are really useful and suit a lot of cases.
However now I need to benchmark a product sale process that consists of several pages including:
froms that should be filled with random data and submitted
cookies / sessions
concurrent requests
invalid form data
ajax requests (form data validation)
In short I would like to simulate a lot of users concurrently buying a product on a webshop (its a so called guest-checkout, so no registration etc is needed)
Right now I am trying to write something in php/curl, specific to the website, but I thought there must be some tools available that I can use. Can somebody point me in the right direction?
I do not need requests from different ip addresses, because the resources expensive stuff happenes all on the backend.
Our product, Web Performance Load Tester, will do everything you mentioned. Filling out and submitting forms is easy and you can generate random sets of data to fill them with, if needed. It handles cookies automatically (unique for each user) and can simulate any number of requests concurrently - by default it will use the same number as the browser you recorded with. Submitting invalid form data is no different than valid data, you simply put invalid data into the set that feeds the form. You can add validators to check for the success/failure of any request or page. It can handle AJAX requests, though this sometimes requires a few extra configuration steps. The quickest way to get an overview of the product is to watch the first two of these videos.
Jmeter allows you to script journeys along the lines you describe, and create random values for things like forms. It's got a fairly steep learning curve - but it's got to be better than writing things from scratch!
Visual Studio WebPerformanceTest and LoadTest will do what you want. You can create a single data driven test (where you pre-create a bunch of test data), or a single test that uses a plugin that on the fly can generate random data. This requires licenses for Visual Studio Ultimate or Team Server.
Check out our Fiddler add-on StresStimulus. It does what you described without scripting: records navigation scenario in browser or Fiddler, replays it with configurable load, automatically supports cookie / session correlation for multi-users, monitors in real time and reports errors and timeouts. To generate random data, use the free service www.generatedata.com and databind the csv files to web form fields in StresStimulus. For more complex load tests, or if AJAX pages break, Fiddler .NET scripting is available. Up to 100 VUs per machine are free. For more VUs, look at low-cost weekly / monthly subscriptions.