- 
                Notifications
    
You must be signed in to change notification settings  - Fork 232
 
          Show first and last node ctime for verdi storage info --detailed
          #6829
        
          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
Conversation
a9babde    to
    472ebe7      
    Compare
  
    
          Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@            Coverage Diff             @@
##             main    #6829      +/-   ##
==========================================
+ Coverage   79.26%   79.27%   +0.01%     
==========================================
  Files         566      566              
  Lines       43794    43798       +4     
==========================================
+ Hits        34711    34715       +4     
  Misses       9083     9083              ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
| 
           @GeigerJ2, Can you please review this PR?  | 
    
| 
           Hi @ayushjariyal, I'm sorry I overlooked this and am just getting back here. Thank you for your contribution! I just rebased the PR to bring it to the current state of the code base. The implementation is good1, could you also add tests for the new functionality? Otherwise, I'm also happy to finalize this (I know it's been long since you opened this). Cheers! Footnotes
  | 
    
| 
           Hi @GeigerJ2 , thanks for reviewing and rebasing the PR! I’ll be happy to add the tests for the new functionality. Could you please point me to the appropriate test file or directory where these should be added?  | 
    
| 
           Regarding the tests, there is a test of the  The test method is located in  You can also add the  Footnotes
  | 
    
          
 Absolutely!  When I was first introducing sqlite-based tests I took a shortcut and automatically marked all tests in   | 
    
9d7ba18    to
    922abc8      
    Compare
  
    | 
           @ayushjariyal, do you have time to work on this? Otherwise, I can also add the tests and we share authorship on the PR? Would like to wrap it up soon :)  | 
    
| 
           @GeigerJ2 , I’m a bit caught up with college work right now, so please go ahead and add the tests. Happy to share authorship on the PR—thanks a lot for helping wrap this up!  | 
    
verdi storage info --detailedverdi storage info (--detailed)
      for more information, see https://pre-commit.ci
verdi storage info (--detailed)ctime for verdi storage info --detailed
      | 
           @danielhollas, maybe you can give this a quick review? Should be simple enough. While this is technically a new feature, and could go into 2.8.0, I think the changes are minor enough that we can put it into 2.7.2. An ASCII histogram of node creation time as written in #6817 (and brought up by Giovanni) seems a bit overkill for now, there are more pressing things to work on.  | 
    
| 
           OK, change of mind. Moved this to 2.8.0. New feature, minor release. Let's follow SemVer properly...  | 
    
          
 Haha, I was gonna write something, now I don't have to (see comment on Discourse :-) ).  | 
    
| .first(flat=True) | ||
| ) | ||
| 
               | 
          ||
| data['Nodes']['first_created'] = str(first_time) if first_time else None | 
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.
Passing None if there are no Nodes results in the following output from verdi storage info --detailed
  Nodes:
    count: 0
    first_created: null
    last_created: null
    node_types: []
    process_types: []
an alternative would be to pass en empty string, which would then look like this:
  Nodes:
    count: 0
    first_created: ''
    last_created: ''
    node_types: []
    process_types: []
I think None makes sense here. cc @GeigerJ2
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.
Yes, agreed, I think null is fine :3
As always, thanks for the review, @danielhollas 🫶
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.
I tweaked the test and tested locally, looks great, thanks @ayushjariyal! 🙏
issue #6817
Updating the code for additional information to be shown with
verdi storage info --detailedby adding the creation time(ctime)and modification time(mtime)of the first and last nodes in the database.