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

Replaces old log output format with the new mint log style #117

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

ebozduman
Copy link
Collaborator

@ebozduman ebozduman commented Aug 21, 2017

Issue #111

@balamurugana
Copy link
Member

@nitisht @ebozduman travis CI fails on npm install. I guess its not related to this PR. We would need to fix this problem before merging this PR

@ebozduman
Copy link
Collaborator Author

I was looking into the failure.

Here are the logged error messages from travis:

npm WARN gulp-babel@7.0.0 requires a peer of babel-core@6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc but none was installed.
npm WARN bin@1.0.0 No description
npm WARN bin@1.0.0 No repository field.
npm ERR! Linux 4.4.0-83-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "--prefix" "/mint/run/core/minio-js" "install"
npm ERR! node v6.11.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! evp_bytestokey@1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the evp_bytestokey@1.0.1 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the evp_bytestokey package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs evp_bytestokey
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls evp_bytestokey
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /mint/npm-debug.log
The command '/bin/sh -c /mint/build/js/install.sh' returned a non-zero code: 1
The command "docker build -f Dockerfile.dev -t play.minio.io/mint:travis-$TRAVIS_PULL_REQUEST_SHA ." exited with 1.
Done. Your build exited with 1.

@nitisht
Copy link
Contributor

nitisht commented Aug 22, 2017

The failure was a Travis CI issue, I restarted the build on Travis and it built fine.

@nitisht nitisht mentioned this pull request Aug 22, 2017
args: args_arr, # array of arg names. This'll be replaced with a
# hash map, arg/value pairs insdie the caller method
comment: comment,
message: nil,
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add the duration section as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do.

@ebozduman
Copy link
Collaborator Author

ebozduman commented Aug 22, 2017

Nitish,
Done.
Added the missing duration field, populated it within each test case method and renamed the comment field as alert as previously decided.

@ebozduman ebozduman force-pushed the ruby_new_log_fmt branch 3 times, most recently from e70babd to b5d5d9e Compare August 22, 2017 21:25
# Create and return log output content
{ name: 'aws-sdk-ruby',
function: "#{meth}(#{args_arr.join(',')})", # method name and arguments
description: desc,
Copy link
Contributor

@nitisht nitisht Aug 23, 2017

Choose a reason for hiding this comment

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

I understand function will have just the API signature while args will have the name:value map.

@nitisht
Copy link
Contributor

nitisht commented Aug 24, 2017

Tested locally, overall looks good. As per #114 (comment), few comments:

  • Duration should be in milli seconds. With the duration field just showing the number (unit is implicit)
  • Fields without any value eg alert, message and error can be ignored in success cases. They should be shown only when there is a value.
  • Function section should show the exact API being tested, instead of the test case function name.

@balamurugana
Copy link
Member

IMO to ensure server quality all errors are alert currently (at least I am not able to differentiate alerts and errors now for current server quality). My suggestion is to keep everything as an error and tests should not continue on error (or alert).

@nitisht
Copy link
Contributor

nitisht commented Aug 24, 2017

IMO to ensure server quality all errors are alert currently

One way to differentiate between error and alert IMO, is cases where there is data loss or data corruption or other severe impact happens (say you upload an object, and then download it and match against original file, and verification fails) can be marked as alert while rest are errors.

@ebozduman
Copy link
Collaborator Author

ebozduman commented Aug 28, 2017

Nitish,

  • Duration is already in milliseconds.
59  def calculate_duration(t2, t1)
60    # Durations are in miliseconds, with precision of 2 decimal places
61    ((t2 - t1) * 1000).round(2)
62  end
  • I'll work on not printing fields, like alert, message,error, when they are set to nil.
  • "function": section already shows the tested api names. Please specify the line number if you've seen a case otherwise.

   - Also adds missing "duration" field and sets it up
   - Implemented comments and modified specs
   - Removes log output fields if nil
@nitisht
Copy link
Contributor

nitisht commented Aug 29, 2017

Tested locally, LGTM. Output:

{
  "name": "aws-sdk-ruby",
  "function": "listBuckets()",
  "args": {},
  "duration": 76,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "listObjects(bucket_name)",
  "args": {
    "bucket_name": "9e4581c73e90"
  },
  "duration": 182.71,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "makeBucket(bucket_name)",
  "args": {
    "bucket_name": "9e4581c73e90"
  },
  "duration": 12.49,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "bucketExists?(bucket_name)",
  "args": {
    "bucket_name": "non-existing-bucket"
  },
  "duration": 3.6,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "removeBucket(bucket_name)",
  "args": {
    "bucket_name": "9e4581c73e90"
  },
  "duration": 8.65,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "putObject(bucket_name,file)",
  "args": {
    "bucket_name": "9e4581c73e90",
    "file": "/mint/data/datafile-1-MB"
  },
  "duration": 32.01,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "removeObject(bucket_name,file)",
  "args": {
    "bucket_name": "9e4581c73e90",
    "file": "/mint/data/datafile-1-MB"
  },
  "duration": 32.02,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "getObject(bucket_name,file,destination)",
  "args": {
    "bucket_name": "9e4581c73e90",
    "file": "/mint/data/datafile-1-MB",
    "destination": "/tmp"
  },
  "duration": 56.58,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "copyObject(source_bucket_name,target_bucket_name,source_file_name,target_file_name)",
  "args": {
    "source_bucket_name": "9e4581c73e90",
    "target_bucket_name": "9da59e6f73f3",
    "source_file_name": "datafile-1-MB",
    "target_file_name": ""
  },
  "duration": 58.88,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "copyObject(source_bucket_name,target_bucket_name,source_file_name,target_file_name)",
  "args": {
    "source_bucket_name": "9e4581c73e90",
    "target_bucket_name": "9da59e6f73f3",
    "source_file_name": "datafile-1-MB",
    "target_file_name": "datafile-1-MB-copy"
  },
  "duration": 79.01,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "presignedGet(bucket_name,file_name)",
  "args": {
    "bucket_name": "9e4581c73e90",
    "file_name": "datafile-1-MB"
  },
  "duration": 46.2,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "presignedPut(bucket_name,file_name)",
  "args": {
    "bucket_name": "9e4581c73e90",
    "file_name": "datafile-1-MB"
  },
  "duration": 42.46,
  "status": "PASS"
}
{
  "name": "aws-sdk-ruby",
  "function": "presignedPost(bucket_name,file_name,expires_in_sec,max_byte_size)",
  "args": {
    "bucket_name": "9e4581c73e90",
    "file_name": "datafile-1-MB",
    "expires_in_sec": 60,
    "max_byte_size": 3145728
  },
  "duration": 51.29,
  "status": "PASS"
}

@deekoder
Copy link
Contributor

running it. Seems to be ok.

@nitisht nitisht merged commit 20b5c8b into minio:master Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants