Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stats: json format #22

Merged
merged 41 commits into from
Jan 24, 2021
Merged

Conversation

luckydonald
Copy link
Collaborator

@luckydonald luckydonald commented Dec 11, 2020

The work regarding #17.

With 374928c we could merge a working version where the json is still missing a few fields, to iterate from there.

It is available via the normal stats endpoint by calling /json as the path.
Everything else will have the old text style.

@luckydonald luckydonald changed the title Json stats + --stats-hide-sensible-data Json stats and --stats-hide-sensible-data flag Dec 11, 2020
@luckydonald
Copy link
Collaborator Author

luckydonald commented Dec 11, 2020

/label ~Enhancement

Edit: Ooops, I tried.

@MarcoBuster MarcoBuster added the enhancement New feature or request label Dec 11, 2020
@MarcoBuster MarcoBuster linked an issue Dec 11, 2020 that may be closed by this pull request
4 tasks
@giuseppeM99
Copy link
Collaborator

ayyyy we broky

@luckydonald
Copy link
Collaborator Author

aww crap.
Like merge conflict or really dead?

@MarcoBuster
Copy link
Collaborator

The latest commit on our master branch (100a7cc) it's causing merge conflicts. While we review and test your code, please resolve them.

telegram-bot-api/HttpStatConnection.cpp Outdated Show resolved Hide resolved
telegram-bot-api/HttpStatConnection.cpp Outdated Show resolved Hide resolved
@MarcoBuster
Copy link
Collaborator

@luckydonald status? We can review it?

@luckydonald
Copy link
Collaborator Author

Ah, yes I think so.

@luckydonald
Copy link
Collaborator Author

Well if those HttpStatConnection thingies are indeed created for every call, that global variable in the object could be used for the decision if we serve as application/json or text/plain.

@luckydonald
Copy link
Collaborator Author

I created dc397e0 with that new way.

};

class JsonStatsBotStats : public td::Jsonable {
public:
explicit JsonStatsBotStats(const std::vector<ServerBotStat> stats) : stats_(stats) {
explicit JsonStatsBotStats(td::vector<ServerBotStat> stats) : stats_(std::move(stats)) {
CHECK(BotStatActor::SIZE == 4 && "Check that we have 4 fields.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&& "Check that we have 4 fields." doesn't make sense

telegram-bot-api/StatsJson.h Outdated Show resolved Hide resolved
telegram-bot-api/StatsJson.h Outdated Show resolved Hide resolved
telegram-bot-api/StatsJson.h Outdated Show resolved Hide resolved
TDLight bot api automation moved this from Review in progress to Reviewer approved Jan 21, 2021
Copy link
Collaborator Author

@luckydonald luckydonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops. Did I start a review on my own now?

jb_root.leave();
sb.clear();
} else {
jb_root("⚠️ WARNING", "The json representation is still a work in progress and will be changed later!");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol remove emoji

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your parser can't handle the unicode, you're out of luck with receiving text messages in telegram anyway...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoBuster MarcoBuster moved this from Reviewer approved to Review in progress in TDLight bot api Jan 24, 2021
@giuseppeM99
Copy link
Collaborator

giuseppeM99 commented Jan 24, 2021 via email

@MarcoBuster MarcoBuster merged commit de05b42 into tdlight-team:master Jan 24, 2021
TDLight bot api automation moved this from Review in progress to Done Jan 24, 2021
@MarcoBuster
Copy link
Collaborator

@giuseppeM99 @luckydonald merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Enhance stats
4 participants