{"action":"created","issue":{"url":"https://api.github.com/repos/outbrain/orchestrator/issues/296","repository_url":"https://api.github.com/repos/outbrain/orchestrator","labels_url":"https://api.github.com/repos/outbrain/orchestrator/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/outbrain/orchestrator/issues/296/comments","events_url":"https://api.github.com/repos/outbrain/orchestrator/issues/296/events","html_url":"https://github.com/outbrain/orchestrator/issues/296","id":191967561,"number":296,"title":"hostname show  truncate","user":{"login":"linuxgood1230","id":13182871,"avatar_url":"https://avatars.githubusercontent.com/u/13182871?v=3","gravatar_id":"","url":"https://api.github.com/users/linuxgood1230","html_url":"https://github.com/linuxgood1230","followers_url":"https://api.github.com/users/linuxgood1230/followers","following_url":"https://api.github.com/users/linuxgood1230/following{/other_user}","gists_url":"https://api.github.com/users/linuxgood1230/gists{/gist_id}","starred_url":"https://api.github.com/users/linuxgood1230/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linuxgood1230/subscriptions","organizations_url":"https://api.github.com/users/linuxgood1230/orgs","repos_url":"https://api.github.com/users/linuxgood1230/repos","events_url":"https://api.github.com/users/linuxgood1230/events{/privacy}","received_events_url":"https://api.github.com/users/linuxgood1230/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-28T10:21:00Z","updated_at":"2016-11-28T12:02:45Z","closed_at":null,"body":"```\r\nhost1:  xx-dd34.zw:333333\r\nhost2:  dd-24.zw:33333\r\n```\r\n\r\nThen ,host show name is :  \r\n```\r\nhost1: xx-dd3\r\nhost2: dd-2\r\n```\r\n\r\nthe same suffix  truncated\r\n\r\n```\r\nfunction commonSuffixLength(strings) {\r\n  if (strings.length == 0) {\r\n    return 0;\r\n  }\r\n  if (strings.length == 1) {\r\n    return 0;\r\n  }\r\n  var longestSuffixLength = 0;\r\n  var maxLength = 0;\r\n  strings.forEach(function(s) {\r\n    maxLength = ((maxLength == 0) ? s.length : Math\r\n      .min(maxLength, s.length));\r\n  });\r\n  var suffixLength = 0;\r\n  while (suffixLength < maxLength) {\r\n    suffixLength++\r\n    var suffixes = strings.map(function(s) {\r\n      return s.substring(s.length - suffixLength)\r\n    });\r\n    var uniqueSuffixes = suffixes.filter(function(elem, pos) {\r\n      return suffixes.indexOf(elem) == pos;\r\n    })\r\n    if (uniqueSuffixes.length > 1) {\r\n      // lost it. keep last longestSuffixLength value\r\n      break;\r\n    }\r\n    // we're still good\r\n    longestSuffixLength = suffixLength;\r\n  }\r\n  return longestSuffixLength;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/outbrain/orchestrator/issues/comments/263254273","html_url":"https://github.com/outbrain/orchestrator/issues/296#issuecomment-263254273","issue_url":"https://api.github.com/repos/outbrain/orchestrator/issues/296","id":263254273,"user":{"login":"shlomi-noach","id":2607934,"avatar_url":"https://avatars.githubusercontent.com/u/2607934?v=3","gravatar_id":"","url":"https://api.github.com/users/shlomi-noach","html_url":"https://github.com/shlomi-noach","followers_url":"https://api.github.com/users/shlomi-noach/followers","following_url":"https://api.github.com/users/shlomi-noach/following{/other_user}","gists_url":"https://api.github.com/users/shlomi-noach/gists{/gist_id}","starred_url":"https://api.github.com/users/shlomi-noach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shlomi-noach/subscriptions","organizations_url":"https://api.github.com/users/shlomi-noach/orgs","repos_url":"https://api.github.com/users/shlomi-noach/repos","events_url":"https://api.github.com/users/shlomi-noach/events{/privacy}","received_events_url":"https://api.github.com/users/shlomi-noach/received_events","type":"User","site_admin":true},"created_at":"2016-11-28T12:02:45Z","updated_at":"2016-11-28T12:02:45Z","body":"Can you please  parity the problem you have? Your expectation?\n\nOn Monday, November 28, 2016, linuxgood1230 <notifications@github.com>\nwrote:\n\n> Thank you\n> You have multi data center . Maybe your all hosts have the same suffix.So\n> you can cut off.\n>\n> —\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/outbrain/orchestrator/issues/296#issuecomment-263242417>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ACfLPiGTL5cjHoRKGj1mxDEeVj3fcivBks5rCrPHgaJpZM4K9nLG>\n> .\n>\n"}}
{"actor":{"display_login":"shlomi-noach"}}