summaryrefslogtreecommitdiff
path: root/indra/newview/lltranslate.h
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2023-02-07 21:42:57 +0000
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-03-20 22:39:48 +0200
commit72cec2d347e9240cd08706ff5155bc29822e2ad8 (patch)
tree7ff0a94304936b79f7a535621c455bbb84fcf62f /indra/newview/lltranslate.h
parentdca3c83cd9f8d1ac8165707b080a420bf9a9a132 (diff)
SL-19161 - logging of basic translation stats in ViewerStats
Diffstat (limited to 'indra/newview/lltranslate.h')
-rw-r--r--indra/newview/lltranslate.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h
index e0722fbd83..58707e2d36 100644
--- a/indra/newview/lltranslate.h
+++ b/indra/newview/lltranslate.h
@@ -30,6 +30,8 @@
#include "llbufferstream.h"
#include <boost/function.hpp>
+#include "llsingleton.h"
+
namespace Json
{
class Value;
@@ -48,8 +50,10 @@ class LLTranslationAPIHandler;
*
* API keys for translation are taken from saved settings.
*/
-class LLTranslate
+class LLTranslate: public LLSingleton<LLTranslate>
{
+ LLSINGLETON(LLTranslate);
+ ~LLTranslate();
LOG_CLASS(LLTranslate);
public :
@@ -94,9 +98,19 @@ public :
static std::string addNoTranslateTags(std::string mesg);
static std::string removeNoTranslateTags(std::string mesg);
+ void logCharsSeen(size_t count);
+ void logCharsSent(size_t count);
+ void logSuccess(S32 count);
+ void logFailure(S32 count);
+ LLSD asLLSD() const;
private:
static LLTranslationAPIHandler& getPreferredHandler();
static LLTranslationAPIHandler& getHandler(EService service);
+
+ size_t mCharsSeen;
+ size_t mCharsSent;
+ S32 mFailureCount;
+ S32 mSuccessCount;
};
#endif