-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add DashboardConfig for fix dashboard-ui 404
add ServiceRegistry.setMetadata api add ServiceRegistry.removeService api add ServiceStatistic.getInstanceCount api add Config/Service/Namespace Management (Dashboard-UI)
- Loading branch information
Showing
29 changed files
with
275 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
local namespace = KEYS[1]; | ||
local serviceIdxKey = namespace .. ":svc_idx"; | ||
|
||
local instanceCount = 0; | ||
|
||
local function getInstanceIdxKey(serviceId) | ||
return namespace .. ":svc_itc_idx:" .. serviceId; | ||
end | ||
|
||
local function statInstance(serviceId) | ||
local instanceIdxKey = getInstanceIdxKey(serviceId); | ||
local servicedInstanceCount = redis.call("scard", instanceIdxKey); | ||
instanceCount = instanceCount + servicedInstanceCount; | ||
end | ||
|
||
local serviceIds = redis.call("smembers", serviceIdxKey); | ||
|
||
for index, serviceId in ipairs(serviceIds) do | ||
statInstance(serviceId) | ||
end | ||
|
||
return instanceCount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
local namespace = KEYS[1]; | ||
local serviceId = ARGV[1]; | ||
|
||
local serviceIdxKey = namespace .. ":svc_idx"; | ||
local serviceIdxStatKey = namespace .. ":svc_stat"; | ||
local instanceIdxKey = namespace .. ":svc_itc_idx:" .. serviceId; | ||
|
||
local instanceCount = redis.call("scard", instanceIdxKey); | ||
if instanceCount > 0 then | ||
return 0; | ||
end | ||
|
||
local affected = redis.call("srem", serviceIdxKey, serviceId); | ||
|
||
if affected > 0 then | ||
redis.call("hdel", serviceIdxStatKey, serviceId); | ||
end | ||
|
||
return affected; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
local namespace = KEYS[1]; | ||
local serviceId = ARGV[1]; | ||
|
||
local serviceIdxKey = namespace .. ":svc_idx"; | ||
local serviceIdxStatKey = namespace .. ":svc_stat"; | ||
|
||
local affected = redis.call("sadd", serviceIdxKey, serviceId); | ||
|
||
if affected > 0 then | ||
redis.call("hset", serviceIdxStatKey, serviceId, 0); | ||
end | ||
|
||
return affected; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.