spite / rstats Goto Github PK
View Code? Open in Web Editor NEWrStats
License: MIT License
rStats
License: MIT License
Right now, rStats will always load CSS for the "Roboto Condensed" Google Font and a stylesheet that must be called rStats.css
(though it can live in a parent directory, not just the current directory).
It'd be nice if you could pass in a setting to override that.
I wondered why the three plugin has this line
https://github.com/spite/rstats/blob/master/src/rStats.extras.js#L101
Forcing a warning when your faces gets above 1,000. This must be arbitrary given you don't know how complex a scene the user will have - mine has many more.
I couldn't create the right incantation to override the value without patching the js.
Any thoughts? Thanks.
I am trying to load a page with the rStats panel hidden. I do $('.rs-base').hide();
after loading jquery and rStats but the panel shows up. What am I missing?
All the for (var j in x)
loops don't check x.hasOwnProperty(j)
. This breaks rstats whenever an app also uses a library that extends the array prototype. Or just iterating using a normal for
loop works as well.
I just with rstats and using the very basic code : rS( 'frame' ).start();
rS( 'rAF' ).tick();
rS( 'FPS' ).frame();--> this line throws error "Cannot read property 'interpolate' of undefined" . any way i can fix it?
Is there any way to destroy rStats after initing? I'm trying to integrate this into a multi-level environment, so I need to be able to take it apart. I'm not seeing anything in the code or docs.
On your example pages (as well as my own experiments), I'm seeing a full document layout in Chrome:
It's only taking around 0.5ms, but I still find it strange that rstats is forcing the entire document to relayout. And in terms of a single frame, that's almost 3% of the total time allotted for 60fps. Obviously rendering rstats is not free, but it should ideally use as little time as possible.
Thanks for making rstats, it's been really cool to use!
A http
URI is used to fetch the "Roboto Condensed" web font. Could this be changed to use https
?
I think I'm looking for something like:
function physicsEngineCollisionCallback(a, b) {
rstats('collisions').mark(); // alternative: .inc()
}
The idea being that we want to know the "flow frequency" of how many collisions are happening over time without manually managing decay.
I could also see this being used to monitor a stream:
someStream.on('data', function(chunk) {
rstats('someStream emit').mark();
});
If I wanted to measure flow rate, .set
is good enough, but not for frequency of flow.
Perhaps this is possible today, and I'm missing something?
For context, I'm measuring both a standard game loop as well as when asynchronous messages arrive via postMessage
from a web worker:
worker.addEventListener('message', function(ev) {
rstats('msgs: recv').tick();
rstats().update(); // ensure the graph always reflects
// Do stuff with message
});
.tick
will measure the time between calls, but I want to measure how many calls over time. Not sure how best to handle that, which is why I'm opening this ticket.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.