Scalaris Management Interface

out(Arg) -> {header, {cache_control, "no-cache"}}.

## Scalaris

Home
Ring
out(Arg) -> case whereis(mgmt_server) of undefined -> {html, ""}; _ -> {html, "
Indexed Ring
Vivaldi Map
" ++ case config:read(dc_clustering_enable) of true -> "
Datacenter Clusters Map
"; _ -> "" end ++ "
Benchmarks
"} end.
Gossip values
Client Monitor
Ring Monitor
Docu
Debug
Message Stats
out(Arg) -> case whereis(mgmt_server) of undefined -> {html, "

## Scalaris Node Info Page

"}; _ -> mgmt_server:number_of_nodes(), NrNodes = receive {get_list_length_response, Res} -> integer_to_list(Res) after 6000 -> "n/a" end, {html, io_lib:format("

## Scalaris Management Server Info Page

Number of nodes: ~s

", [NrNodes])} end.

### Simple Storage

#### Add Key Value

Key |
Value |

| Reset

out(A) -> IsPost = webhelpers:isPost(A), if IsPost -> {ok, Type} = postvar(A,"type"), if Type =:= "addkey" -> case {postvar(A, "key"),postvar(A, "value")} of {{ok, Key},{ok, Value}} -> {Time, Result} = webhelpers:set_key(Key, Value), {ehtml, {pre, [], io_lib:format('~w ms: ~p', [Time / 1000, Result])}}; _ -> {ehtml, {pre, [], "

Missing required input: Need a Key and Value
"}} end; true -> {ehtml,{pre, [], ""}} end; true -> {ehtml,{pre, [], ""}} end.

#### Search

Key

| Reset

out(A) -> IsPost = webhelpers:isPost(A), if IsPost -> {ok, Type} = postvar(A,"type"), if Type =:= "querykey" -> case postvar(A, "key") of {ok, Key} -> {Time, Result} = webhelpers:lookup(Key), {ehtml, {pre, [], io_lib:format('~w ms: ~p', [Time / 1000, Result])}}; _ -> {ehtml, {pre, [], ""}} end; true -> {ehtml, {pre, [], ""}} end; true -> {ehtml, {pre, [], ""}} end.

#### Delete

WARNING: This can lead to inconsistent data (e.g. deleted items can re-appear). Also when re-creating an item the version before the delete can re-appear.
Key |
Timeout |

| Reset

out(A) -> IsPost = webhelpers:isPost(A), if IsPost -> {ok, Type} = postvar(A,"type"), if Type =:= "deletekey" -> case {postvar(A, "key"),postvar(A, "timeout")} of {{ok, Key},{ok, TimeoutStr}} -> Timeout = try list_to_integer(TimeoutStr) catch _:badarg -> 2000 end, {Time, Result} = webhelpers:delete_key(Key, Timeout), {ehtml, {pre, [], io_lib:format('~w ms: ~p', [Time / 1000, Result])}}; _ -> {ehtml, {pre, [], ""}} end; true -> {ehtml, {pre, [], ""}} end; true -> {ehtml, {pre, [], ""}} end.

### Args

out(A) -> IsPost = webhelpers:isPost(A), case IsPost of true -> {ehtml, {pre, [], io_lib:format("GET:~p~nPOST:~p", [yaws_api:parse_query(A), yaws_api:parse_post(A)])}}; false -> {ehtml, {pre, [], io_lib:format("GET:~p", [yaws_api:parse_query(A)])}} end.

Last update: out(Arg) -> {Date, {Hour, Minute, Second}} = calendar:local_time(), {html, io_lib:format("~2..0B:~2..0B:~2..0B", [Hour, Minute, Second])}.