-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add --diff option teraslice-cli #3710
Conversation
c3e763b
to
afd09e4
Compare
Co-authored-by: Peter Luitjens <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Here is an example on how this option looks. In the json file I change the amount of workers from 1 to 2 and run:
Output: {
"_context": "job",
"_created": "2024-08-01T22:34:50.219Z",
- "_updated": "2024-08-06T16:03:58.734Z",
+ "_updated": "2024-08-06T16:03:58.777Z",
"assets": [
"standard",
"file"
],
"job_id": "48e59745-ed75-4060-998e-002262abefc3",
"lifecycle": "once",
"name": "data-to-s3",
"operations": [
{
"_op": "data_generator",
"size": 100000
},
{
"_op": "s3_exporter",
"format": "ldjson",
"path": "josephorigin"
}
],
- "workers": 1
+ "workers": 2
}
It does appear that updated seems slightly off all the time and maybe we shouldn't compare it? |
I think it could be helpful to know that |
Should this be some sort of warning like, "_update field is subject to being slightly different from job file, to whats on the job record in the state cluster". Or should I just ignore this comparison entirely? |
My feeling is that it's fine how it is now and a warning isn't necessary. But maybe it would be better to not compare |
If there is no difference could it out put something like - no difference between the configs instead of printing the whole config, not a big deal it's a pain to do so Also, what color applies to what config? Green is the local file and red is the cluster config? Maybe something to let people know what applies to what. So far as the It is interesting to know when the job was last updated, but if the diff is 100 ms it doesn't really tell me anything useful. So maybe if there's a way to hide that diff unless it's at least a few min difference that would be better. |
I've updated the behavior to include what is being compared to what. I also added logic around the "_updated" field to only display a diff if the time difference is greater than a minute. Results if "_updated field is less than 1 minute": {
"assets": [
"standard",
"file"
],
"job_id": "48e59745-ed75-4060-998e-002262abefc3",
"lifecycle": "once",
"name": "data-to-s3",
"operations": [
{
"_op": "data_generator",
"size": 100000
},
{
"_op": "s3_exporter",
"format": "ldjson",
"path": "josephorigin"
}
],
- "workers": 1 <--- state cluster value
+ "workers": 2 <--- local job file value
}
Results if "_updated field is greater than 1 minute": {
- "_updated": "2024-08-06T16:03:58.734Z", <--- state cluster value
+ "_updated": "2024-07-06T16:03:58.777Z", <--- local job file value
"assets": [
"standard",
"file"
],
"job_id": "48e59745-ed75-4060-998e-002262abefc3",
"lifecycle": "once",
"name": "data-to-s3",
"operations": [
{
"_op": "data_generator",
"size": 100000
},
{
"_op": "s3_exporter",
"format": "ldjson",
"path": "josephorigin"
}
],
- "workers": 1 <--- state cluster value
+ "workers": 2 <--- local job file value
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
This PR makes the following changes:
--diff
option toteraslice cli view
that will compare the localjson
job file with what teraslice has on the state clusterteraslice-cli
fromv2.1.0
tov2.2.0
Ref to issue #3694