Firebase客户端可以确定发送和接收的字节吗? [英] Can a Firebase client determine the bytes sent and received?

查看:133
本文介绍了Firebase客户端可以确定发送和接收的字节吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在浏览器控制台中检查各种Firebase JavaScript对象的结构时,我注意到有些对象具有以下属性:

  bytes_received:429 
bytes_sent:64

这似乎表明数据量发送和接收这个节点/ ref /快照。

是否有结构化的方式让客户端访问这些信息?

解决方案

不是。 : - )



您可以看到客户端跟踪的一些内部统计信息。唯一的方法就是使用:

  Firebase.INTERNAL.stats(firebaseRef); 

然后将它们转储到控制台。 (请注意,这些统计信息适用于与Firebase进行的所有互动,而不仅仅是特定的firebaseRef。)



这不是受支持的API,可随时消失或更改。它也可能与您在Forge仪表板中看到的不完全匹配(客户端不知道发生的一些传输开销)。但是,如果它在开发/调试期间帮助你,那么很好。

While inspecting the structure of the various Firebase JavaScript objects in the browser's console, I noticed that some objects have these properties:

bytes_received: 429
bytes_sent: 64

This seems to indicate the amount of data that was sent and received for this node/ref/snapshot.

Is there a structured way for a client to access this information?

解决方案

Not really. :-)

You're seeing some internal stats the client keeps track of. The only way to get at them is with:

Firebase.INTERNAL.stats(firebaseRef);

And it'll dump them to the console. (Note that the stats are for all interactions with the Firebase, not just that particular firebaseRef.)

This isn't a supported API and could disappear or change at any time. It also may not match up exactly with what you see in the Forge dashboard (the client is unaware of some of the transport overhead that goes on). But if it helps you at all during development / debugging, great.

这篇关于Firebase客户端可以确定发送和接收的字节吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆